Continuity, closed set and Hausdorff space Let $f , g : X \rightarrow Y$ be continuous where $Y$ is Hausdorff. Prove that $A = \{x : f(x) = g(x)\}$ is closed in $X$.
I have done the followings.
$f(X)$ and $g(X)$ are two subspaces of $Y$.
As Y is Hausdorff, $f(X), g(X)$ and $f(X) \times g(X)$ are also.
$L = \{(f(X),g(X)) : f(X) = g(X)\}$ is closed in $f(X) \times g(X)$.
Inverse image of a closed set is closed under continuous mapping.
Thus $\{x : f(X) = G(X)\} \subset X$ is closed.
Is my approach correct? Last steps (closedness of $L$ and closedness of $L \Rightarrow$ closedness of $A$) is not clear to me. Please explain. if this process is not correct or any easier method is available, please give it. 
Thank you.
 A: I don't completely understand what you are doing, but this is how I would do this problem : To show that $C = \{x\in X : f(x) = g(x)\}$ is closed, you can show that $C^c$ is open. Choose $x \in C^c$, then $f(x) \neq g(x)$. Since $Y$ is Hausdorff, there exist open sets $U, V \subset Y$ such that
$$
f(x) \in U, g(x) \in V \text{ and } U\cap V = \emptyset
$$
Take $W = f^{-1}(U)\cap g^{-1}(V)$, then $W$ is open (since $f$ and $g$ are continuous), and for any $z \in W$,
$$
f(z) \in U, g(z) \in V \Rightarrow f(z) \neq g(z)
$$
Hence, $W$ is a neighbourhood of $x$ that is contained in $C^c$. Hence, $C^c$ is open.
A: $Y$ is Hausdorff iff the diagonal $\Delta\subseteq Y\times Y$ is closed. And $A=(f,g)^{-1}(\Delta)$.
A: Your $L$ is empty if $f[X]\ne g[X]$, and it contains the single pair $\langle f[X],g[X]\rangle$ if $f[X]=g[X]$. This is a pair of subsets of $Y\times Y$ and is definitely not what you want. I'll get you started on a correct version of this approach.
Let $Y_f=f[X]$ and $Y_g=g[X]$, and define a function
$$\varphi:X\to Y_f\times Y_g:x\mapsto\langle f(x),g(x)\rangle\;.$$
Let $\Delta=\{\langle y,y\rangle:y\in Y\}$, and note that $Y_f\times Y_g$ and $\Delta$ are both subsets of $Y\times Y$, so it makes sense to let $L=(Y_f\times Y_g)\cap\Delta$.


*

*Use Hausdorffness of $Y\times Y$ to show that $\Delta$ is closed in $Y\times Y$.  

*Use this to show that $L$ is closed in $Y_f\times Y_g$.   

*Show that $\varphi$ is continuous.  

*Conclude that $\varphi^{-1}[L]$ is closed in $X$.  

