How to prove that the limit of a function is $0$ at every point I have the following function defined on $\mathbb{R}$:

$$f(x) = \begin{cases}
    0 &amp; \text{if $x$ irrational} \\
    1/n &amp; \text{if $x = m/n$ where $m, n$ coprime}
  \end{cases}$$

I want to show that $f$ is continuous at every irrational point, and has a simple discontinuity at every rational point. I was able to show the first and partially the second (I showed that $f$ has a discontinuity at every rational point, but got stuck on showing that the discontinuity is simple).

However, I've realized that I can simply show that $\lim_{t \rightarrow x}f(t) = 0$ for every $x$, and both of the things I want to show follow from this. How can I show this?
Take any $x$. Let $\epsilon &gt; 0$, and find $N$ such that $\frac1 N &lt; \epsilon$.

Now, I claim that there is a $\delta&gt;0$ such that if $y \in (x-\delta,x+\delta) \backslash \{ x\}$, then $y$ is not of the form $\frac mN$ for any integer $m$. Suppose not. Then, considering $\delta$ going to zero and repeatedly contradicting the statement, we get a sequence $y_n = \frac {m_n}N$ such that $y_n \to x$. Now, $m_n \to Nx$. However, remember that $m_n$ are integers, and convergence can only happen in the integers if the sequence is eventually constant! (because different integers are at least $1$ distance from each other). So, $y_n$ is eventually constant. You can work it out from here.

With this lemma, surely the proof is not too far away, is it?
HINTS: observe that there are a finite number of rationals $n/m&lt;1$ for any fixed $m$ (observe that Im not taking into account if $n$ and $m$ are coprime or not).

Now remember that exists infinite rationals of the kind $n/p&lt;1$ where $p$ is prime.

What happen with $m$ when you approximate a number $x$ with a rational $n/m$?