Evgeny.Makarov said:Suppose that $f$ is continuous at some rational point $x_0\in\mathbb{Q}$. Then for $\varepsilon=1/2$ there exists a $\delta>0$ such that for an open interval $U=(x_0-\delta,x_0+\delta)$ we have $f(U)\subseteq(1/2,3/2)=(f(x_0)-1/2,f(x_0)+1/2)$. But this is impossible since every neighborhood of $x_0$, including $U$, contains an irrational point that is mapped to $0$ by $f$. The case of irrational $x_0$ is considered similarly.