Let $f:\Bbb{R}\to \Bbb{R}$ be defined by
$$f(x)=\begin{cases}1& \text{if x is rational},\\0 &\text{if x is irrational.}\end{cases}$$
Prove that $f$ is discontinuous at every real number. I realize that if $x_0\in\Bbb{R} $, then every neighborhood of $x_0$ contains rational points (at which $f(x)=1$) and contains irrational points (at which $f(x)=0$). I see that the existence of $\lim\limits_{x\to x_0}f(x)$ is also in question. From here, I don't know how to proceed. Can anyone help me out?
$\Bbb Q$ is dense in $\Bbb R$ so for $x_0$ being irrational we have a sequence of rational terms $(a_n)$ convergent to $x_0$. Now if $f$ is continuous at $x_0$ then
$$1=\lim_{n\to\infty}f(a_n)=f(x_0)=0$$ which is a contradiction. Same reasoning for $x_0$ being rational and by using that $\Bbb R\setminus \Bbb Q$ is also dense in $\Bbb R$.