of [[Discontinuous Function]].
# Example 1
**Theorem**
Suppose that $g,h: \mathbb{R} \to \mathbb{R}$ are both continuous and let $f(x) = \begin{cases}
g(x) & x\in \mathbb{Q} \\
h(x) & x \not \in \mathbb{Q}
\end{cases}$Then $f$ is [[Continuous Real Function|continuous]] at $c$ iff $g(c) = h(c)$ otherwise it is [[Discontinuous Function|discontinuous]].
**Proof**
$g(c) \neq h(c)$ implies discontinuous: suppose that $g(c) \neq h(c)$ and consider the case $c \in \mathbb{Q}$.
Then there exists a sequence $x_{n} \not \in \mathbb{Q}$ such that $x_{n} \to c$
So $\lim_{ n \to \infty } f(x_{n}) = h(x_{n}) \to h(c) \neq g(c) = f(c)$.
A similar argument works if $c \not \in \mathbb{Q}$ (taking $(x_{n}) \in \mathbb{Q}$ with $x_{n} \to c$).
Conversely, if $g(c)=h(c)$ then given $\epsilon>0$ since $g$ is continuous at $c$ there exists $\delta_{1}>0$ such that $|x-c|<\delta_{1} \implies |g(x)-g(c)|<\epsilon$and since $h$ is continuous at $c$ there exists $\delta_{2}>0$ such that $|x-c|<\delta_{2} \implies |h(x)-h(c)|< \epsilon$Then with $\delta = \min(\delta_{1},\delta_{2})$, if $|x-c|<\delta$ we have either $x \in \mathbb{Q}$ and then $|x-c|<\delta<\delta_{1} \implies |h(x)-h(c)|<\epsilon.$or $x \not \in \mathbb{Q}$ so $|x-c|<\delta<\delta_{2} \implies |f(x)-f(c)|<\epsilon$in both cases $|x-c|<\delta$ ensures $|f(x)-f(c)|<\epsilon$ so $f$ is continuous at $c$.
# Other Examples
- [[Sign Indicator Function is Discontinuous at 0]].
- [[Floor Function is Discontinuous at Every Lattice Point]].
- [[Rational indicator function is everywhere discontinuous]].
- [[Thomae's function is discontinuous at rational points and continuous at irrational points]].