1. ## Dense subset

Let $\displaystyle X$ and $\displaystyle Y$ be metric spaces and let $\displaystyle D$ be a dense subset of $\displaystyle X$. Let $\displaystyle f: X \to Y$ and $\displaystyle g: X \to Y$ be continuous functions. Suppose that $\displaystyle f(r) = g(r)$ for all $\displaystyle r \in D$. Prove that $\displaystyle f = g$.

Proof. Let $\displaystyle r \in X \backslash D$. Then $\displaystyle r$ is a limit point of $\displaystyle D$ by the denseness of $\displaystyle D$. Pick a decreasing sequence of positive real numbers $\displaystyle (x_n)$. Then in each open ball $\displaystyle B_{x_{n}}(r)$, there is a point $\displaystyle q_n \neq r$ such that $\displaystyle q_n \in D$. Form these terms as a sequence $\displaystyle (q_n)$. Fix $\displaystyle \epsilon > 0$. Since $\displaystyle x_n \to 0$ any open ball centered at $\displaystyle 0$ contains at least one $\displaystyle x_j$ for some $\displaystyle j \in \mathbb{N}$. So there is some $\displaystyle j$ such that $\displaystyle x_j \in B_{\epsilon}(0)$. Then for $\displaystyle n \geq j$, $\displaystyle q_{n} \in B_{\epsilon}(r)$. So $\displaystyle q_n \to r$. Then $\displaystyle g(r) = \lim_{n \to \infty} g(q_n)$. We know that $\displaystyle q_n \in D$ for $\displaystyle n \in \mathbb{N}$. Thus $\displaystyle f(q_n) = g(q_n)$ which implies $\displaystyle f(r) = g(r)$. Thus $\displaystyle f = g$. $\displaystyle \blacksquare$

Is this correct?

2. Originally Posted by particlejohn
Let $\displaystyle X$ and $\displaystyle Y$ be metric spaces and let $\displaystyle D$ be a dense subset of $\displaystyle X$. Let $\displaystyle f: X \to Y$ and $\displaystyle g: X \to Y$ be continuous functions. Suppose that $\displaystyle f(r) = g(r)$ for all $\displaystyle r \in D$. Prove that $\displaystyle f = g$.

First, you must do away with thinking of a general metric space as the real numbers alone. That is, a decreasing sequence of points has no general meaning.

Now suppose that $\displaystyle \left( {\exists x} \right)\left[ {f(x) \ne g(x)} \right]$ clearly $\displaystyle x \in X\backslash D$.
As you noted, by density there is a sequence of distinct points $\displaystyle \left( {x_n } \right) \to x\,\&\,x_n \in D$.
$\displaystyle \left( {\exists \delta > 0} \right)\left[ {B_\delta \left( {f(x)} \right) \cap B_\delta \left( {g(x)} \right) = \emptyset } \right]$.
But $\displaystyle f\left( {x_n } \right) = g\left( {x_n } \right)\,\& \,\left( {f\left( {x_n } \right)} \right) \to f(x)\,\& \,\left( {g\left( {x_n } \right)} \right) \to g(x)$.