It would be very appreciated if someone could review my proof written below. Thanks!
Problem:
Let $f, g : X \to Y$ be continuous; assume $Y$ is Hausdorff. Show that $\{x \mid f(x) = g(x)\}$ is closed in $X$.
Proof:
Let $f, g: X \rightarrow Y$ be continuous where $Y$ is Hausdorff.
Let $C = \{x \mid f(x) = g(x)\}$
Suppose $C$ is not closed. Then let $x_1 \notin C$ where $x_1$ is a limit point of $C$. Then $f(x_1) \neq g(x_1)$ in $Y$. Then since $Y$ is Hausdorff we can find disjoint open sets $U$ and $V$ containing $f(x_1)$ and $g(x_1)$ respectively. Then $f^{-1}[U]$ and $g^{-1}[V]$ are open sets in $X$ since $f$ and $g$ are continuous and both sets contain the point $x_1$.
Then consider the set $A = f^{-1}[U] \cap g^{-1}[V]$. This set is open and must also contain the point $x_1$. Since $x_1$ is a limit point of $C$ the set $A$ must contain some point $z \in C$. Then $f(z) = g(z)$ and since $z \in A$ we have $f(z) \in U$ and $g(z) \in V$. But since $f(z) = g(z)$ we have $U \cap V \neq \emptyset$ as both sets contain $f(z)$. Hence we have obtained a contradiction since $U$ and $V$ were chosen to be disjoint and thus $x_1$ must be a point in $C$ (or equivalently $x_1$ is not a limit point and is not a member of C )
So $C$ must contain all its limit points and thus $C$ is closed.