Let $f, g : [0,1] \to \mathbb{R}$ continuous and equal on $\mathbb{Q}\cap [0,1]$, prove $f=g$ Let $f : [0,1] \to \mathbb{R}$ and $g: [0,1] \to \mathbb{R}$ be continous,  and $\forall x \in [0,1] \cap \mathbb{Q}, f(x) = g(x)$.  Prove $f=g$
$[0,1] \cap \mathbb{Q}$ is neither closed nor open. So there exists $a_n \in [0,1] \cap \mathbb{Q}$ s.t. $a_n \to x $ and $x \notin [0,1] \cap \mathbb{Q}$
Let $x \in [0,1] \cap \mathbb{Q}$  and $x_n \in [0,1]$ s.t. $x_n \to x$ and by the continuity of $f,g$ : 
$ f(x_n) \to f(x) $ and $ g(x_n) \to g(x)$ 
Not sure how to get to $f = g$ 
 A: It looks like you have the right idea.
Let $x\in [0,1]$ be arbitrary. We prove that $f(x)=g(x)$. If $x\in\mathbb{Q}$, then we are done, so suppose that $x\not\in\mathbb{Q}$. Take a sequence $\{x_n\}\subseteq\mathbb{Q}\cap[0,1]$, such that $x_n\rightarrow x$. Since $f$ and $g$ are continuous, we have that
$$f(x) = \lim_{n\to\infty} f(x_n) = \lim_{n\to\infty} g(x_n) = g(x).$$
A: Hint: The fact that you need about $[0,1]\cap \Bbb Q$ is that wen you take its closure, you get all of $[0,1]$.
A: Remember that $\mathbb{Q}$ is dense in $\mathbb{R}$, i.e. $\overline{\mathbb{Q}}=\mathbb{R}$. The reason for that is that any interval contains rationals. In fact, if $x\in \mathbb{R}$ and $\epsilon >0$ is any positive real number $(x-\epsilon,x+\epsilon)$ has some rational element, so it intercepts $\mathbb{Q}$ and hence $x\in \overline{\mathbb{Q}}$.
In that case $\mathbb{Q}\cap [0,1]$ is dense in $[0,1]$, that is, $\overline{\mathbb{Q}\cap[0,1]}=[0,1]$. This means that if $x\in [0,1]$ then there is a sequence $(x_n)$ with $x_n\mathbb{Q}\cap\in[0,1]$ such that $x_n\to x$ as $n\to \infty$.
In that case, if $x\in [0,1]$ we have
$$f(x)=f(\lim x_n),$$
but $f$ is continuous so that
$$f(x)=\lim f(x_n),$$
but now $x_n\in \mathbb{Q}\cap [0,1]$ so that $f(x_n)=g(x_n)$. In that case you get
$$f(x)=\lim g(x_n)$$
and finaly by continuity of $g$ we have $f(x)=g(x)$. Out of curiosity, replace $[0,1]$ by any metric space $M$ and $\mathbb{Q}\cap [0,1]$ by any dense subset $Q$ and the result will still hold. Continuous functions which agree on a dense subset are equal on the whole space.
