Dirichlet_function
[!warning] AI-Generated This file was generated by AI and may require review.
Definition
The Dirichlet function $g: \mathbb{R} \to \mathbb{R}$ is defined by
$$ g(x) = \begin{cases} 1 & \text{if } x \in \mathbb{Q} \\ 0 & \text{if } x \notin \mathbb{Q} \end{cases} $$This function is discontinuous at every point.
Proof of Discontinuity
Let $c \in \mathbb{R}$. By the density of rationals and irrationals, every neighborhood of $c$ contains both rational and irrational points.
If $c \in \mathbb{Q}$, then $g(c) = 1$, but there exist sequences of irrationals approaching $c$ where $g = 0$.
If $c \notin \mathbb{Q}$, then $g(c) = 0$, but there exist sequences of rationals approaching $c$ where $g = 1$.
In either case, $\lim_{x \to c} g(x)$ does not exist, so $g$ is discontinuous at $c$.