Let f,g: X->Y be a continuous function. Assume that Y is Hausdorff and that there exists a dense subset D of X such that f(x)=g(x) for all $\displaystyle x \in D$ .
Prove that f(x)=g(x) for all $\displaystyle x \in X$
Since f(x)=g(x) for all $\displaystyle x \in D$ by the hypothesis of the problem, it remains to show that f(x)=g(x) for all $\displaystyle x \in X \setminus D$.
Suppose to the contrary that $\displaystyle f(x) \neq g(x)$ for some $\displaystyle x \in X \setminus D$. Since Y is Hausdorff, we have disjoint open sets U and V containing f(x) and g(x), respectively. Since f and g are continuous, x belongs to an open set $\displaystyle f^{-1}(U) \cap g^{-1}(V)$. We know that D is dense in X, which implies that every open set in X intersects a dense subset D. Thus, an open set $\displaystyle f^{-1}(U) \cap g^{-1}(V)$ intersects D. Let y belongs to that intersection. Since y belongs to $\displaystyle f^{-1}(U) \cap g^{-1}(V)$ , $\displaystyle f(y) \neq g(y)$. Since y also belongs to D, we have f(y)=g(y) by the hypothesis of the problem. Contradiction !
Thus, $\displaystyle f(x) = g(x)$ for all $\displaystyle x \in X \setminus D$.