Two continuous functions that are the same in the rationals. Can anybody check my proof?
Let $f,g:\mathbb{R}\to \mathbb{R}$ continuous functions such that $f\restriction \mathbb{Q}=g\restriction \mathbb{Q}$. If $\mathbb{R}$ is given the usual topology, then $f=g$.
Proof (contradiction):
Let $x\in \mathbb{R}$ such that $f(x)\neq g(x)$. Take $\epsilon=\frac{1}{3} \vert f(x)-g(x) \vert$ and let $W=(f(x)-\epsilon, f(x)+\epsilon)$ and $Z=(g(x)-\epsilon, g(x)+\epsilon)$. $W$ and $Z$ are open in $\mathbb{R}$, $f(x)\in W$, $g(x)\in Z$ and $W\cap Z=\emptyset$.
Then, because $f$ and $g$ are continuous, $f^{-1}(W)$ and $g^{-1}(Z)$ are open in $\mathbb{R}$. Then $f^{-1}(W)\cap g^{-1}(Z)$ is open and $x\in f^{-1}(W)\cap g^{-1}(Z)$. Now, $\mathbb{R}$ was given the usual topology, so $\overline{\mathbb{Q}}=\mathbb{R}$. Then there exists $q\in \mathbb{Q}\cap f^{-1}(W)\cap g^{-1}(Z)$, and since $f\restriction_{\mathbb{Q}}=g\restriction_{\mathbb{Q}}$, then $f(q)=g(q)$. Also, $f(q)\in W$ and $g(q)\in Z$, then $f(q)=g(q)\in W\cap Z$, a contradiction.
 A: The proof is fine as it stands, nicely based on first principles.
An alternative: the "set of equality" $E = \{x \in X: f(x) = g(x)\}$ is closed in $X$ whenever $f,g: X \rightarrow Y$ are continuous on with $Y$ Hausdorff.
This is because 


*

*$f \nabla g: X \rightarrow Y \times Y$, defined by $(f \nabla g)(x) = (f(x), g(x))$ is continuous when $f$ and $g$ are.

*$Y$  is Hausdorff iff $\Delta_Y = \{(y,y): y \in Y\}$ is closed in $Y$.

*$E= (f \nabla g)^{-1}[\Delta_Y]$  
As $\mathbb{Q} \subseteq E$ by assumption: $\mathbb{R} = \overline{\mathbb{Q}} \subseteq \overline{E} = E$, which means that $f= g$ on the reals.
This is more of a proof based on other generally useful facts, where this one falls out of as a byproduct. This is to give alternatives. As said: your proof is also fine. 
Specifically for the reals and not for general spaces: suppose $x \in \mathbb{R}$. Find a sequence $(q_n)$ from $\mathbb{Q}$ such that $q_n \rightarrow x$. 
Then $f(x) = f(\lim_n q_n) = \lim_n f(q_n) = \lim_n g(q_n) = g(x)$ where we use sequential continuity of $f$ and $g$, and the fact that limits of sequences are unique. 
If you know nets, one could transform the metric proof to a general one again, with Hausdorff co-domain, on any $X$. 
A: [Remarks on the proof in Revision 2]
Your proof is good and to the point. I have two small critiques though.
I would include the justification for this step:
Let $x\in \mathbb{R}$ such that $f(x)\neq g(x)$ and let $W$ and $Z$ be open in $\mathbb{R}$ such that $f(x)\in W$, $g(x)\in Z$ and $W\cap Z=\emptyset$.
I would also mention the reason why $f(q)=g(q)$ later on, no matter how obvious it is.
As a side note: Your second paragraph essentially proves the following proposition.
Let $X$ and $Y$ be topological spaces, and let $D\subset X$ be dense. If there exist distinct continuous functions 
$$ f,g\colon X\to Y$$
such that
$$ f\restriction D=g\restriction D,$$
then $Y$ is not a Hausdorff space.
A: Every real number $x$ can be seen as a limit of a sequence $\{x_m\}_{m\in \mathbb{N}}$ of rational numbers, i.e., $x_n \rightarrow x$. As $f$ and $g$ are continuous functions, we have that $f(x_n)=g(x_n)$ because all $x_m$ are rational numbers. But by continuity, we have that $f(x)=lim_{n\rightarrow \infty}f(x_n)=lim_{n\rightarrow \infty}g(x_n)=g(x)$. So $f(x)=g(x)$ for every real number $x$.
