I have been using Munkres' Topology in my Topology class and we have been going over homework exercises. One of my classmates submitted a pretty sizable proof to a question, but mine was only a few lines. I am now uncertain whether or not I made some mistake in my proof. The question and my solution are included below.
Chapter 31 Exercise 5: Let $f, g : X \to Y$ be continuous: assume that $Y$ is Hausdorff. Show that $\{x | f(x) = g(x)\}$ is closed in $X$.
Proof: Note that $S = X - \{x | f(x) = g(x)\} = \{x | f(x) \neq g(x)\}$. Clearly $S$ is open in $X$ as the arbitary union of elements in $X$. Hence $\{x | f(x) = g(x)\}$ is closed in $X$.
Did I make a major mistake in this proof?
You just sort of stated that you were done, without providing much justification.
My answer had an error in it. The condition $\{x:f(x)=g(x)\}$ is closed is in fact equivalent to $Y$ being Hausdorff. See @HennoBrandsma's response.