If $f\mathop: X \to Y$ and $g\mathop: X \to Y$ are continuous and $f(x) = g(x)$ for all $x \in E$, then $f(x) = g(x)$ for all $x \in X$.

Let $$X$$ and $$Y$$ be metric spaces and $$E$$ be a dense subset of X. Show that if $$f\mathop: X \to Y$$ and $$g\mathop: X \to Y$$ are continuous and $$f(x) = g(x)$$ for all $$x \in E$$, then $$f(x) = g(x)$$ for all $$x \in X$$.

Greetings, I am trying to prove this using the $$\epsilon -\delta$$ characterization of continuity. I already know how to prove it with the sequential characterization. Here is what I have so far:

Proof. Let $$E$$ be a dense subset of $$X$$. Let $$f:X \to Y$$ and $$g: X\to Y$$ be continuous on $$X$$ such that $$f(x) = g(x)$$ for all $$x\in E$$. Suppose to the contrary that $$f(x) \neq g(x)$$ for some $$x\in X$$. Since $$E$$ is dense in $$X$$, $$\overline{E} = X$$. Hence, there exists $$x_0 \in E'$$ such that $$f(x_0) \neq g(x_0)$$. Let $$\epsilon > 0$$. Choose $$\delta_1>0$$ such that $$x\in X$$ and $$d_X(x,x_0)<\delta_1$$ implies $$d_Y(f(x),f(x_0)) < \frac{\epsilon}{2}$$. Choose $$\delta_2 > 0$$ such that $$x\in X$$ and $$d_X(x,x_0)< \delta_2$$ implies $$d_Y(g(x),g(x_0)) < \frac{\epsilon}{2}$$. Put $$\delta = \min\{\delta_1,\delta_2\}$$. Then if $$x\in E$$ and $$d_X(x,x_0)< \delta$$ we have $$d_Y(f(x_0),g(x_0)) \leq d_Y(f(x_0),f(x)) + d_Y(f(x),g(x_0)) < \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon$$ which implies that $$f(x_0) = g(x_0)$$, a contradiction.

Now, is this sufficient to prove the statement? Notice that my inequality is only true for $$x\in E$$ since the assumption is that $$f(x) = g(x)$$ for all $$x\in E$$. I think I need to consider $$x\in E'$$ and show a similar inequality. Thanks for your help.

Just change "Then if $$x \in E$$ and $$d_X(x,x_0) < \delta...$$" by "There exists $$x \in E$$ such that $$d_X(x,x_0) < \delta$$..." and the proof follows. You can change because $$x_0$$ is in the closure and then for every open set around $$x_0$$ exists $$x \in E$$ such that $$d_X(x,x_0) < \delta$$.