[Math] For what values of $x$ is $f$ Continuous

calculuslimits

For what values of $x\in\mathbb{R}$ is $f$ continuous?

$f(x) = \left\{
\begin{array}{lr}
0 & \text{if}\, x \in \Bbb Q\\
1 & \text{if}\, x \notin \Bbb Q
\end{array}
\right.$

The solution I found:

$f(x)$ is continuous nowhere. For, given any number $a$ and any $\delta>0$, the interval $(a-\delta, a+ \delta)$ contains infinitely many rational numbers and infinitely many irrational numbers.

Since $f(a) = 0$ or $1$, there are infinitely many numbers $x$ with $0<|x-a|< \delta $, and $|f(x) – f(a)| = 1$

Thus, $\lim_{x \to a}f(x) \neq f(a)$

My question: I'm having a hard time visualizing that you can't have a rational number $x$ with rational numbers on both sides of that $x$ such that $\lim_{x \to a}f(x) = f(a)$(is that because you can go as 'deep' in to the interval as you like to reach the irrational number?). Can anybody attempt to give me some insight in to how this works?

I have never given it much thought that you can have infinitely many numbers even in the smallest of intervals, and it's pretty overwhelming for me to even imagine.

Best Answer

Let $x_0\in \mathbb Q$. Then $(x_n)$, where $x_n=x_0+\frac{\sqrt{2}}{n}$ is a sequence of irrationals such that $x_n\to x_0$. But $f(x_n)=1$ for all $n\in \mathbb N$ and $f(x_0)=0$. Thus $(f(x_n))$ can not converge to $f(x_0)$. Thus $f$ is not continuous at any point of $\mathbb Q$.

Similarly it can be shown that $f$ is not continuous at any point of $\mathbb R\setminus \mathbb Q$.

Related Question