How to prove this function is continuous Consider the following function on $[0,1]$: $$  f(x) =
\begin{cases}
1/m,  & \text{if $x={m\over n} \in \Bbb Q$} \\
0, & \text{if $x$ $\notin \Bbb Q$}  \\
\end{cases}$$
Here, as usual, $\Bbb Q$ is the collection of all rational numbers and we assume that $m$ and $n$ have no common divisors. Prove that the function $f$ is continuous at any point $x \in [0,1]$\ $\Bbb Q$ . (any irrationals in $[0,1]$)
Please give a rigorous proof, or you can just give me a hint.

Hint Let $x$ be any irrational in $(0,1)$. Then for any $n >0$ there are only finitely many fractions in $(0,1)$ whose denominator is less than $n$. Thus you can find one of them, lets call it $\frac{k}{m}$ which is closest to $x$. 
But then if $y$ is closer than $\frac km$ to $x$, then either $y$ is irrational, or is rational and has a denominator larger than $n$.
This is the main idea of the proof, you should be able to write it easily now with $\epsilon, \delta$...
