Proving that $f$ is identically zero 
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)
 A: The step following "since $\epsilon$ is arbitrary..." is not quite right.
You have shown that if $d \in (c-\delta, c+\delta) \cap \mathbb{R} \setminus \mathbb{Q}$, then $|f(d)|< \epsilon$. You want to say that you could just make epsilon smaller and smaller; the problem with this is that $\delta$ depends on $\epsilon$. If you want $|f(d)|< \frac{\epsilon}{2}$, you might need to be in a smaller interval $(c-\eta, c+\eta)$ for some $\eta< \delta$. So you cannot conclude that $|f(d)|<\epsilon$ for all $\epsilon>0$, just for the epsilon you chose.
The slickest way to prove this is to use the fact that $f$ is continuous if and only if for every sequence $(x_n)$ such that $\lim_{n \to \infty}x_n \to x_0$, we have $\lim_{n \to \infty}f(x_n) \to f(x_0)$. If you let $x_0 \in \mathbb{R} \setminus \mathbb{Q}$, can you choose a sequence $(x_n)$ so that $\lim_{n \to \infty} f(x_n)=0$? (This works if $f(x_n)=0$ for all $n$...)
If you want to go the delta-epsilon route, then given $c \in \mathbb{R}\setminus \mathbb{Q}$, you know for all $\epsilon>0$ there exists $\delta>0$ such that for all $x \in (c-\delta,c+\delta)$, $|f(x)-f(c)|< \epsilon$. In particular, for each $\epsilon$ and corresponding $\delta$, there will be an $x \in (c-\delta,c+\delta) \cap \mathbb{Q}$. What can you conclude from that?
A: Let $x\in\mathbb R$. By continuity, $f(x)=\lim_{y\to x}f(y)$. Since this limit exists, it is independent of the manner of approach $y\to x$; specifically, we may assume that $y\to x$ through rational values since $\mathbb Q$ is dense in $\mathbb R$. But then $f(x) = \lim_{y\to x} 0 = 0$.
A: A slightly more topological approach:


Theorem: Let $(X, \tau_X)$, $(Y, \tau_Y)$ be two topological spaces. Suppose $Y$ is Hausdorff and that $D \subset X$ is a dense subset in $X$. Let $f,g: X \to Y$ be two continuous functions such that $f_{|D}=g_{|D}$. Then $f=g$ on $X$.


The theorem is proven in this question.
Now, $f_{|\mathbb Q}=0$ and $\mathbb Q$ is dense in $\mathbb R$, which is Hausdorff. By the previous theorem,
$$f=0$$
A: Only thing that remains to show is that $f(r)=0\forall r\in \Bbb  Q^c$
Since $\Bbb Q$ is dense in $\Bbb R$ so given $r\in \Bbb  Q^c;\exists r_n\in \Bbb  Q$ such that $r_n\to r$
$f$ is continuous so  $r_n\to r\implies f(r_n)\to f(r)\implies f(r)=0$
