Let $f,g:X \to Y$ be continuous, $Y$ Hausdorff. Show $\{x:f(x)=g(x)\}$ is closed in $X$.
Here is my attempt.
We seek to show $\{x: f(x)=g(x)\}^c \subset X$ is open. That is we aim to show if $x_0 \in \{x:f(x)=g(x)\}^c$ there exists a neighborhood $U$ of $x_0$ such that $U \subset \{x:f(x)=g(x)\}^c$. If $x_0 \in \{x:f(x)=g(x)\}^c$ then $f(x_0) \neq g(x_0)$ which are in $Y$ who is Hausdorff thus there exists open sets $V,W \subset Y$ that are disjoint with
$$f(x_0) \in V, g(x_0) \in W.$$
By continuity of $f$ their pre-images, $f^{-1}(V),f^{-1}(W) \subset X$ are open in $X$ and contain $x_0$. So do I take the union or intersection of their pre-images to find my $U$ orrr?? Any hints greatly appreciated. Also, am I going about this the right way?? BTW this is exercise $\S$ $31.5$ out of Munkres.