Show that $f(x) = 0$ for all $x \in \mathbb{R}$ 
$f: \mathbb{R} \to \mathbb{R}$ is continuous with $f(x)=0$ for all $x \in \mathbb{Q}$. Show that $f(x) = 0$ for all $x \in \mathbb{R}$.

Can anyone please point me in the right direction as to how I can go about answering this question?


Let $X$ be a metric space, with a dense subset $D$. If $f\colon X\to \mathbb{R}$ and $g\colon X\to \mathbb{R}$ are continuous functions such that $f(x)=g(x)$ for all $x\in D$, then $f=g$.

Proof. Consider the function $h(x)=f(x)-g(x)$. Then $D\subseteq h^{-1}(\{0\})$ and $h^{-1}(\{0\})$ is a closed subset. Therefore $h^{-1}(\{0\})=X$.
In your case $X=\mathbb{R}$, $D=\mathbb{Q}$ and $g$ is the zero constant function.
