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 & \text{if $x$ irrational} \\
    1/n & \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?
 A: Take any $x$. Let $\epsilon > 0$, and find $N$ such that $\frac1 N < \epsilon$.
Now, I claim that there is a $\delta>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?
A: Hint.
For $x \in \mathbb R$ and $\epsilon > 0$, the set
$$S(x,\epsilon,n)=\{p/q \ ; \; p \in \mathbb Z \text{ and } 1 \le q \le n \text{ and } p/q \in (x-\epsilon,x+\epsilon) \setminus\{x\}\}$$ is finite.
A: HINTS: observe that there are a finite number of rationals $n/m<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<1$ where $p$ is prime.
What happen with $m$ when you approximate a number $x$ with a rational $n/m$?
