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*}
The mistake is in claiming that $y_1 \in V_1$ and $y_2 \in V_2$. You cannot say this unless $f$ is injective.