Let $X$ and $Y$ be topological spaces, and let $f$, $g\colon X \rightarrow Y$ be two continuous functions. Let $F = \{ x \in X \colon f(x) = g(x) \}$. Prove that, if $Y$ is Hausdorff, then $F$ is closed.
My attempt:
Assume $F$ is open. Let $U \subset Y$ be the image of $f$ on $F$, which is equivalent to the image of $g$ on $F$. Let $a$ and $b$ be two points in $U$. Since $Y$ is Hausdorff, there exist neighborhoods $N_a$, $N_b \subset U$ such that $N_a \cap N_b = \emptyset $.
I have a hunch there is a contradiction to be drawn from the pre images of these two neighborhoods, but haven't been able to find it.