$$ \begin{align} t(x) = \begin{cases} 0 & \text{if $x$ is irrational}\\ \frac{1}{n} & \text{if $x = \frac{m}{n}$ where $\gcd(m,n) = 1$} \end{cases} \end{align} $$
I can prove the discontinuity at rational $b$ by taking a sequence of irrationals $x_n$ which converge to $b$.
But while going through an argument for continuity at irrationals. I found this in a book.
On the other hand if $b$ is an irrational number and $\epsilon > 0$ then there is a natural number $n_0$ such that $1/n_0 < \epsilon$. There are only finite number of rationals with denominator less than $n_0$ in the interval $(b-1,b+1)$. Hence we can find a $\delta > 0$ such that $\delta$ neighbourhood of $b$ contains no rational with denominator less than $n_0$.
I understand the rest of the proof. But I am unable to prove the emphasized text. Although I find it intuitive.