Folland Exercise 4.16 I'm stuck on this problem from Folland's Real Analysis.
Here it is.
Let $X$ be a topological space. Let $Y$ be a Hausdorff space. Let $f$ and $g$ be continuous maps from $X$ to $Y$.
a) $\{ x | f(x) =g(x) \}$ is closed
b) if $f=g$ on a dense subset of $X$, then $f=g$ on all of $X$.
My idea is for a) is very vaguely this: make a product space out of the image of $f$ and $g$ (a subset of $Y\times Y$). Show the that the compliment of the desired set is open because $Y$ is hausdorff (not sure how to do this). Then use the continuity of the injections and functions to get a closed set in $X$. Any hints would be greatly appreciated. I haven't made much progress on b). Thanks you in advance.
 A: That $Y$ be Hausdorff is equivalent to: the diagonal $\Delta Y$ is closed in $Y\times Y$. Now consider the function $h=(f,g) : X \longrightarrow Y\times Y$ for the first claim. For the second, use the first: let $E$ be the set where $f=g$, and suppose there is a dense set $D$ such that $D\subseteq E$. Now take closures and use $E=\bar E$. 
A: *

*Let $A=\{x|f(x)\neq g(x)\}$, then if $x\in A$ it follows that  $f(x)\neq g(x)$. Thus there exist two neighboorhoods $W$ and $V$ with $f(x)\in W$, $g(x)\in V$ and $W\cap V=\emptyset$. So clearly $x\in f^{-1}(W)\cap g^{-1}(V)$. So using this can you see how the set $A$ is open and thus it's complement $X/A$ is closed?  

*If $X/A=\{x|f(x)=g(x)\}$ is dense then the closure $cl(X/A)=X$ by definition. But $X/A=cl(X/A)$ since $X/A$ is closed. So what can be deduced by this? 
A: Let $\phi:Y \to Y^2$ be the duplicator $\phi(y) := (y,y)$ and $\psi:X \to Y^2$ with $\psi(x) := (f(x),g(x))$. Observe that the set in (a) is simply $\psi^{-1} \circ \phi[Y]$. Show that $\psi$ is continuous, and $\phi[Y]$ is closed. This proves (a). (b) follows immediately since a closed dense set is the whole space.
