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.