Let $$ f(x) = \begin{cases} 1 & \text{if } x=0\\ \frac{1}{q} & \text{if } x = \frac{p}{q} \ \text{with } \gcd(p,q) = 1\\ 0 & \text{if } x\in\Bbb{R}\setminus\Bbb{Q} \end{cases} $$ Find where $f$ is continuous.
So as the rationals are dense in the irrationals, and the irrationals are dense in the rationals, I believe that the function $f$ is nowhere continuous. Is this correct, and if so, how do you formally prove that (with $\varepsilon$-$\delta$ definition of continuity)?
Edit: @SpamIAm has pointed out that the function in fact is continuous at all irrationals. I would like to see a proof of that.