Suppose that $f:\mathbb{R}\rightarrow\mathbb{R}$ is continuous on $\mathbb{R}$ and that $f(r) = 0$ for every rational number $r$. Prove that $f(x) = 0$ $\forall$ $x \in \mathbb{R}$
Ok, here's what I've done:
Let $c \in \mathbb{Q}$.
Since, $f$ is continuous so $\forall \epsilon > 0$ $\exists \delta > 0$ such that $\forall x \in (c-\delta, c+\delta)$, we should have $|f(x)| < \epsilon$. Now, let $d \in (c-\delta, c+\delta) \cap \mathbb{R} \setminus \mathbb{Q}$, $|f(d)| < \epsilon$. Since $\epsilon$ is arbitrary, we have $f(d) =0$
Hence, $\forall c \in \mathbb{Q}$, $\exists \delta > 0$ such that $\forall$ $|x-c| < \delta$, $f(x) = 0$
From here, how do I deduce that $f(x) = 0$ $\forall x \in \mathbb{R}$?
(Just to mention : I can intuitively think that it should be true because like you can go on taking union of these neighbourhoods but I was unable to rigorously prove it)