Let $X,Y$ be Hausdorff and $f,g : X \to Y$ continuous. Let $A \subset X$ be dense and suppose that $f\mid_A = g\mid_A$. Show that $f=g$.
Suppose the contrary that $f \ne g$. This implies that there exists $x \in X$ such that $f(x)\ne g(x)$. As $Y$ is Hausdorff we can consider neighborhoods $U_{f(x)}$ and $U_{g(x)}$ for which we have that $U_{f(x)} \cap U_{g(x)} = \emptyset$. Now $$f^{-1}(U_{f(x)} \cap U_{g(x)})=f^{-1}(U_{f(x)}) \cap f^{-1}(U_{g(x)})=\emptyset$$ but this is a contradiction since both of them contain at least $x$?
I'm not sure if the proof is correct since I'm not using the density of $A$ at all. Isn't it true that $x \in f^{-1}(U_{f(x)}) \cap f^{-1}(U_{g(x)})$?