Assume $f:\mathbb{R}\rightarrow\mathbb{R}$ is continuous on $\mathbb{R}$ and such that $f(r)=0$ for every rational number $r$. Show that $f(x)=0, \forall x\in\mathbb{R}$ using the $\varepsilon-\delta$ definition of continuity.
I am attempting to do this by contradiction. If we assume $f(y)\neq 0$ for some irrational number $y$, we should be able to come up with a contradiction to the definition of continuity at point $y$. I am not quite sure how to arrive at the contradiction, though.
Relevant facts:
Let $A\subseteq\mathbb{R}, f:A\rightarrow\mathbb{R}$ and $c\in A$. Then $f$ is continuous at $c$ if $\forall\varepsilon>0, \exists\delta>0$ such that if $x\in A$ and $|x-c|<\delta$, then $|f(x)-f(x)|<\varepsilon$.
If $x,y\in\mathbb{R}$ and $x<y, \exists r\in\mathbb{Q}$ such that $x<r<y$.
If $x,y\in\mathbb{R}$ and $x<y, \exists z\in\mathbb{R\setminus Q}$ such that $x<z<y$.
The first is just the definition of continuity at a point. The second and third state that between any two real numbers you can find both a rational and irrational number, which I think may come in to play somewhere.
Argue by contradiction:
Suppose there is some irrational $r$ such that $f(r) \neq 0$; let $d := |f(r)|$. If $f$ is continuous on $\Bbb{R}$, then there is some $\delta > 0$ such that $|x-r| < \delta$ only if $|f(x) - f(r)| < d/2$. But there is some rational $x$ such that $|x-r| < \delta$, implying that for that rational $x$ we have $|f(x) - f(r)| = |0 - f(r)| = d > d/2$, a contradiction.