Continuous irrational function proof Let $f,g$ be two defined and continuous function on $[a,b]$ suppose that $f(x)=g(x)$ for all rational $x∈[a,b]$. Prove that that $f(x)=g(x)$ for all real $x∈[a,b]$
Since this is true for rational I know that I need to prove it also true for irrational, but I don't know how to do it.
 A: Define $h(x)=f(x)-g(x)$ for all $x\in [a,b]$. The function $h$ is continuous on $[a,b]$ and $h(x)=0$ for all rational $x\in [a,b]$. Let $y\in [a,b]$ be an arbitrary irrational, then there exists sequence $\{x_{n}\}$ of rational elements of $[a,b]$ such that $x_{n}\rightarrow y$, now since $h$ is continuous on $[a,b]$, so $h(x_{n})\rightarrow h(y)$ but $h(x_{n})=0$ for every natural $n$, therefore $h(y)=0$ and the proof is done.
A: Where do the maps $f,g$ go to? A topological space, a metric space, or simply $\mathbb{R}$?
Assuming you mean metric space, let $F(x) := d(f(x),g(x))$ (if you meanr $\mathbb{R}$, this comes out as  $F(x) := |f(x) - g(x)|$). You can check that $F:\ [a,b] \to \mathbb{R}$ is a continuous function. By the assumption, you have that $F(x) = 0$ for $x \in \mathbb{Q}$. Look at $F^{-1}(\{0\})$. On one hand, this contains $\mathbb{Q} \cap [a,b]$. On the other hand, this is a closed set because $F$ is continuous and $\{0\}$ is closed. Hence,  $F^{-1}(\{0\})$ contains the closure of $\mathbb{Q} \cap [a,b]$, which is $[a,b]$. But this means that $f(x) = g(x)$ for all $x \in [a,b]$, which finishes the proof. 
