Let $X$ be a compact Hausdorff space. If $f:X\rightarrow Y$ is continuous, closed, and surjective, prove that $Y$ is Hausdorff.
I'm wondering if/where the compactness of $X$ is needed. I have the following 'proof', but I'm rather skeptical as it
doesn't depend on the compactness of $X$. Where is the mistake in my proof?
Proof: Let $y_1,y_2\in Y$ be distinct. Then there are $x_1,x_2\in X$ such that $f(x_i)=y_i$. Since $X$ is Hausdorff, there exist disjoint open neighborhoods $U_1, U_2$ of $x_1$ and $x_2$, respectively. As $f$ is closed, $f(X\backslash U_i)\subseteq Y$ are also closed. Thus, if $V_i:=Y\backslash f(X\backslash U_i)$, then $V_1$ and $V_2$ are disjoint open neighborhoods of $y_1$ and $y_2$, respectively, where disjointness follows from
\begin{align*}
Y\backslash( V_1\cap V_2)&=Y\backslash V_1\cup Y\backslash V_2 \\
&=f(X\backslash U_1)\cup f(X\backslash U_2)\\
&=f(X\backslash U_1\cup X\backslash U_2)\\
&=f(X\backslash (U_1\cap U_2))\\
&=f(X)\\
&=Y.
\end{align*}
Best Answer
The non-injectivity failure in your current proof has already been pointed out. Now instead of disjoint neighbourhoods $U_1,U_2$ of $x_1$ and $x_2$, use disjoint neighbourhoods of the closed sets $F_i = f^{-1}[\{y_i\}]$ ($i=1,2$) of $X$ and the same construction of open sets. This does use compactness (why?) and we do get neighbourhoods of $y_i$ ( this needs a small argument).
A more general theorem:
This captures the essence of the proof and does not require $X$ to be compact (we need the compactness of the fibres, really).