Let $f:\mathbb{R}\rightarrow\mathbb{R}$ and $g:\mathbb{R}\rightarrow\mathbb{R}$ continuous functions; if $f(x)=g(x)$ $\forall x\in\mathbb{Q}$ then $f(x)=g(x)$ $\forall x\in\mathbb{R}$
3 Answers
Remember that $\mathbb{Q}$ is dense in $\mathbb{R}$. Let $x\in\mathbb{R}$ and $(x_n)_n$ a series with $x_n\in\mathbb{Q}$ for all $n\in\mathbb{N}$ and $\lim x_n= x$. By continuity we get $f(x)=\lim f(x_n)=\lim g(x_n)=g(x)$ for all $x\in\mathbb{R}$.
By continuity of $f-g$ we have $(f-g)^{-1}(0)$ closed and dense by assumption, hence all of $\mathbf{R}$. (Use this to prove that $f(x+y)=f(x)+f(y)$ implies $f(x)=f(1)x$ by showing that it holds for $x\in\mathbf{Q}$, you will enjoy this-) This result holds more generally for any two maps $X\rightarrow Y$ where $X$ is any topological space and $Y$ a Hausdorff space; it is often useful.

- 417
Hint: If $(x_{n})_{n=1}^{\infty}\subseteq \mathbb{R}$ is a sequence converging to $x\in \mathbb{R}$, then $\lim_{n\to\infty}h(x_{n})=h(x)$ for any continuous function $h:\mathbb{R}\to\mathbb{R}$.

- 8,303