Continuous function and dense set Let $f: X \rightarrow Y $ and $g:X \rightarrow Y$ continuous functions and $(X,d_X),(Y,d_Y)$ metric space. Let $E$ be a dense subset in $X$. Prove that $f(E)$ is a dense subset in $f(X)$. If $f(p)=g(p)$ for all $p\in E$, prove that $f(x)=g(x)$ for all $x\in X$.
My attempt: since $E \subset X \Rightarrow f(E)\subset f(X)$ and from the dense property we have $f(X) \subset f(\overline{E})$ and since $f$ is continuous, $f(X) \subset f(\overline{E}) \subset \overline{f(E)}$. Then, $f(E)$ is dense in $f(X)$.
Suppose that $f(p)=g(p), \;  \forall p \in E$. Hence, we have
$$d_{Y}(f(x),g(x)) \leq d_{Y}(f(x),f(p)) + d_{Y}(f(p),g(x)) = d_{Y}(f(x),f(p)) + d_{Y}(g(p),g(x)).$$ By the fact that $f,g$ are continuous, there exist a $\delta_1$ and $\delta_2$ such that $$d_X(x,p) < \delta_1 \qquad d_X(x,p) < \delta_2$$
implies $$d_{Y}(f(x),f(p))<\epsilon /2 \qquad d_{Y}(g(p),g(x)) < \epsilon /2.$$ for all $\epsilon >0.$
Is this correct?
 A: The first part is perfect. The second part needs a little more help. To prove the second part, let $\epsilon > 0$ and $x\in X$. Since $f$ and $g$ are continuous, there exist $\delta_1, \delta_2 > 0$ such that for all $p\in X$, $d_X(x,p) < \delta_1$ implies $d_Y(f(x),f(p)) < \epsilon/2$ and $d_X(x,p) < \delta_2$ implies $d_Y(g(x), g(p)) < \epsilon/2$. Since $E$ is dense in $X$, there is point $e\in E$ such that $d_Y(x,e) < \min\{\delta_1, \delta_2\}$. Thus
\begin{align}d_Y(f(x),g(x)) &\le d_Y(f(x),f(e)) + d_Y(f(e),g(x))\\
& = d_Y(f(x),f(e)) + d_Y(g(e),g(x)) \\
&< \frac{\epsilon}{2} + \frac{\epsilon}{2} \\
&= \epsilon.\end{align}
Since $\epsilon$ was arbitrary, $f(x) = g(x)$. Finally, since $x$ was arbitrary, $f = g$.
A: For the second part I think 'sequence argument' looks better. For this, take $x\in X$. Since $E$ is dense in $X$, there exists a sequence $\{x_n\}\subseteq E$ such that $x_n\to x$ in $X$. Since both $f$ and $g$ are continuous, it follows that $f(x_n)\to f(x)$ and $g(x_n)\to g(x)$. Also $f(x_n)=g(x_n)$ as $x_n\in E$, for all $n$. Hence by the uniqueness of limit (since we are in the metric space, a convergent sequence has a unique limit) we have $f(x)=g(x)$. As $x\in X$ is arbitrarily chosen, $f(x)=g(x)$ on $X$ as desired.
