Let $X$ be a topological space and let $Y$ be a Hausdorff space. Let $D$ be dense in $X$. Prove that continuous functions $f, g : X \to Y$ which are equal in $D$ are equal in all $X$.
I'm a little stuck with this elementary proof. All help appreciated :)
Assume there is $x \in X$ such that $f(x) \neq g(x)$. Since $Y$ is Hausdorff, there are neighborhoods $U$ and $V$ of $f(x)$ and $g(x)$ respectively such that $U \cap V = \emptyset$. Since $f$ and $g$ are continuous, $f^{-1}(U) \cap g^{-1}(V)$ is open and nonempty (it contains $x$) in $X$ and therefore contains an element $x_0$ of $D$. Now, $f(x_0) \in U$ and, since $x_0 \in D$, $f(x_0) = g(x_0) \in V$, so $f(x_0) \in U \cap V$, contradicting the fact that $U$ and $V$ are disjoint.