A nicer result can be seen as following:
Theorem: For any pair $f,g$ of continuous mappings of a space $X$ into a Hausdorff space $Y$, the set $\{x\in X: f(x)=g(x)\}$ is closed in $X$.
Proof: We shall show that the set $A=\{x \in X: f(x)\not=g(x)\}$ is open. For every $x \in A$ we have $f(x)\not=g(x)$; hence there exist in $Y$ open sets $U_1, U_2$ such that $f(x)\in U_1$, $g(x)\in U_2$ and $U_1\cap U_2=\emptyset$. The set $f^{-1}(U_1) \cap g^{-1}(U_2)$ is a neighbourhood of $x$ contained in $A$.
And hence,
Corollary: For any pair $f,g$ of continuous mappings of a space $X$ into a Hausdorff space $Y$ with $f(x)=g(x)$ for any $x\in S$, where $S$ a dense subset of $X$, then for any $x\in X$, $f(x)=g(x)$.
Proof: It is clearly to see that $S \subset \{x\in X: f(x)=g(x)\}$. By the above theorem, we can conclude that $\overline{S} \subset \{x\in X: f(x)=g(x)\}$, and hence $X = \{x\in X: f(x)=g(x)\}$.