Here is Prob. 5, Sec. 31, in the book Topology by James R. Munkres, 2nd edition:
Let $f, g \colon X \rightarrow Y$ be continuous; assume that $Y$ is Hausdorff. Show that $\big\{ x \vert f(x) = g(x) \big\}$ is closed in $X$.
My Attempt:
Let $X$ and $Y$ be any topological spaces, and let $f \colon X \rightarrow Y$ and $g \colon X \rightarrow Y$ be continuous mappings; suppose that $Y$ is a Hausdorff space. Let us put $$ S \colon= \big\{ \, x \in X \, \vert \, f(x) = g(x) \, \big\}. \tag{Definition 0} $$ We need to show that this set $S$ is closed in $X$. For this we show that the set $X \setminus S$ is open in $X$.
Let $p$ be any point of $X \setminus S$. Then $p \in X$ and $f(p) \neq g(p)$, that is, $f(p)$ and $g(p)$ are two distinct points of the Hausdorff space $Y$, which implies that there exist disjoint open sets $V_f$ and $V_g$ of $Y$ containing $f(p)$ and $g(p)$, respectively. Let us now put $$ U_f \colon= f^{-1} \left( V_f \right) \qquad \mbox{ and } \qquad U_g \colon= g^{-1} \left( V_g \right). \tag{Definition 1} $$ Then as the maps $f \colon X \rightarrow Y$ and $g \colon X \rightarrow Y$ are continuous, as $V_f$ and $V_g$ are open sets in $Y$ containing $f(p)$ and $g(p)$, respectively, so both the sets $U_f$ and $U_g$ are open sets in $X$ containing the point $p$. Let us now put $$ U_p \colon= U_f \cap U_g. \tag{Definition 2} $$ Then $U_p$ is an open set of $X$ containing the point $p$.
Moreover, if $x \in U_p$, then we have $x \in U_f$ and $x \in U_g$, that is, $x \in X$ for which $f(x) \in V_f$ and $g(x) \in V_g$, and as $V_f$ and $V_g$ are disjoint, so we can conclude that $f(x) \neq g(x)$, and thus $x \in X \setminus S$. Thus it follows that $$ U_p \subset \, X \setminus S. $$
Thus we have shown that for any point $p \in X \setminus S$, there exists an open set $U_p$ of $X$ such that $p \in U_p$ and $U_p \subset X \setminus S$. Thus $X \setminus S$ is an open set in $X$, by Prob. 1, Sec. 13, in Munkres. Hence $S$ is a closed set in $X$.
Is this proof correct? If so, is it clear enough for any novice student of topology? Or, is it incorrect somewhere or unclear?
Quite clear, I agree with the comments on that point.
As an additional proof idea:
I think Munkres also has an exercise (or maybe a theorem) where he shows that $Y$ is Hausdorff iff $\Delta_Y = \{(y,y): y \in Y\}$ is closed in $Y \times Y$ in the product topology.
And if $f,g: X \to Y$ are continuous, so is $f \nabla g: X \to Y \times Y$ defined by $(f \nabla g)(x)=(f(x), g(x))$ e.g. because $\pi_1 \circ (f \nabla g) = f$ and $\pi_2 \circ (f \nabla g) = g$ and the universal property of continuity of product maps.
Then note that by definition $$S=(f \nabla g)^{-1}[\Delta_Y]$$
and is thus closed in $X$ for a Hausdorff space $Y$.