Let $f, g : [0, 1] \to [0, 1]$ be continuous functions that agree on the rationals inside $[0, 1]$. Show that $f = g$. Give an example of a continuous function $f : \mathbb Q \to\mathbb R$ such that there is no continuous function $g : \mathbb R \to\mathbb R$ with the property that $f = g|_\mathbb Q$
I am not really understanding the problem. From my notes, I have " Let $x\in [0,1]$ such that $f(x) \neq f(y)$. Considering a neighborhood of $f(x),$ and $f(y), V$ and $W$ respectively. Then there exists a $q \in V\cup\mathbb Q$ and $r \in W\cup\mathbb Q$. "
How does this prove $f = g$?
Your notes should start "Let $x$ be such that $f(x) \neq g(x)$" Where did $y$ come from? If we want to prove $f(x)=g(x)$ we are interested in the values of the two functions at a common argument. Since the rationals are dense, you can take the limit of $f(x)$ and $g(x)$ approaching $x$. The limits have to agree because $f(x)=g(x)$ on the rationals. You find $f(x)=g(x)$ for all $x$.