I'd like to know if the following proof is valid. The only thing I'm not sure about (though I can't see why it's invalid if it is) is if we can always use the Hausdorfness of $Y$ to separate an open set from $f(C)=g(C)$.
"Let $X$ be a space, $Y$ a $T_2$-space, and $f,g:X \to Y$ continuous functions. Prove that $C:=\{x \in \,|\,f(x)=g(x)\}$ is a closed subset of $X$."
Let $x \in X$ be such that $f(x) \ne g(x)$. Since $Y$ is $T_2$, there are open sets $U_\alpha \ni f(x)$ and $V_\alpha \ni g(x)$ such that $U_\alpha \cap O_\alpha=V_\alpha \cap O_\alpha=\varnothing$ for all $\alpha \in A$ where $A$ is the set indexing the points of $f(C)=g(C)$, and $O_\alpha$ is an open set containing $x_\alpha \in f(C)=g(C)$. Let $U:=\displaystyle\bigcap_{\alpha \in A} U_\alpha$ and $V:=\displaystyle\bigcap_{\alpha \in A} V_\alpha$. Then $U \cap f(C)=V \cap f(C)=\varnothing$. Therefore, since $f,g$ are continuous, $f^{-1}(U)$ and $g^{-1}(V)$ are open sets in $X$ disjoint from $C$. Since $X\setminus A$ is the union of such open sets, it is open itself and therefore $C$ is closed.
Thanks.