[Math] X is compact and Y is Hausdorff and connected prove a function is surjective

general-topology

I need help proving the following.

A function $f:X\to Y$ is an open map if whenever $U$ is an open subset of $X$, then $f(U)$ is an open subset of $Y$. Let $X$ and $Y$ be topological spaces. prove that if $X$ is compact, $Y$ is Hausdorff and connected, and $f\colon X\rightarrow Y$ is a continuous open map, then $f$ is surjective.

Thank you!

Best Answer

Hint: $f(X)$ is open and closed in $Y$.