Find where $f$ is continuous We have a function $f: \mathbb{R} \to \mathbb{R}$ defined as
$$\begin{cases} x; \ \ x \notin \mathbb{Q} \\ \frac{m}{2n+1}; \ \ x=\frac{m}{n}, m\in \mathbb{Z}, n \in \mathbb{N} \ \ \ \text{$m$ and $n$ are coprimes} \end{cases}.$$
Find where $f$ is continuous
 A: Hint: Since $f(x) \simeq x/2$ at the rationals with large enough denominator and $f(x) = x$ at the irrationals, is there any way for $f$ to be continuous anywhere besides zero? Both the rationals and irrationals are dense, i.e. strictly in between any two distinct rationals or irrationals you can find both a rational and irrational.
A: If $x \in \mathbb{R} \setminus \mathbb{Q}$, then $f(x) = x$. If $x = \frac{m}{n} \in \mathbb{Q}$, where $m, n$ are as they ought to be, then $f(x) = \frac{m}{2 n + 1} < \frac{m}{2n} = \frac{1}{2} \left( \frac{m}{n} \right) = \frac{x}{2}$. So what's important for determining continuity at $x_{0}$ is that we get the same limit whether we approach along rationals or irrationals. But if $x_{0} \geq 0$, then
\begin{align*}
0 &\leq \limsup_{x \to x_{0}}^{(\mathbb{Q})} & \leq \frac{x_{0}}{2} , \\
0 &\leq \limsup_{x \to x_{0}}^{( \mathbb{R} \setminus \mathbb{Q})} & = x_{0},
\end{align*}
so we'd need that $x_{0} = x_{0} / 2$, so $x_{0} = 0$. Similarly if $x_{0} \leq 0$, then
\begin{align*}
0 &\geq \liminf_{x \to x_{0}}^{(\mathbb{Q})} & \geq \frac{x_{0}}{2} , \\
0 &\geq \liminf_{x \to x_{0}}^{( \mathbb{R} \setminus \mathbb{Q})} & = x_{0},
\end{align*}
so again we need $x_{0} = x_{0} / 2$, i.e. $x_{0} = 0$.
