Let $f,g:X \to Y$ be continuous, $Y$ Hausdorff. Show $\{x:f(x)=g(x)\}$ is closed in $X$. 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.
 A: You're going about this exactly the right way, you just need to finish off.
$V$ is an open neighbourhood of $f(x_0)$, $W$ an open neighbourhood of $g(x_0)$, and they are disjoint.
$f^{-1}(V)\cap g^{-1}(W)$ is an open neighbourhood of $x_0$ in $X$: let's call it $U$. If $x\in U$, then I know $f(x)\in V$ and $g(x)\in W$, and I know $V\cap W=\emptyset$, so it is not possible that $f(x)=g(x)$. That means: $$U\subseteq\{x\in X:f(x)\neq g(x)\}$$As desired.
A: There is another concise approach with net.
Let $A = \{x \in X \mid f(x) = g(x)\}$ and show that $A = \overline{A}$.
Proof:
Suppose that $a \in \overline{A}$, then there exists a net $x = (x_{i})_{i \in I} \colon I \to A$ such that $\lim x = a$ (i.e. the net $x$ converges to $a$), by continuity at $a$, we have $\lim (f(x_{i}))_{i \in I} = f(a)$ and $\lim (g(x_{i}))_{i \in I} = g(a)$. Since $f(x_{i}) = g(x_{i})$ for each $i \in I$ and limits are unique in $Y$, hence
$$f(a) = \lim (f(x_{i}))_{i \in I} = \lim (g(x_{i}))_{i \in I} = g(a)$$
that means $a \in A$. Thus $\overline{A} \subseteq A$.
