Let $f: X\mapsto Y$ be a closed continuous surjective map such that $f^{-1}(y)$ is compact, for each $y\in Y$. Show that if $Y$ is compact, then $X$ is compact.
My question is why do we need $f$ to be continuous? It seems I can prove this result without continuity.
Here is my proof:
Let $\left\{ U_{\alpha}:\alpha\in J\right\} $ be an open covering of $X$. Since $f$ is surjective and $f^{-1}\left(y\right)$ is compact, for any $y\in Y$, there exists a finite set $J_{y}\subset J$ such that $\left\{ U_{\alpha}:\alpha\in J_{y}\right\} $ is an open covering of $f^{-1}\left(y\right)$. Suppose we can find a finite set $\tilde{Y}\subset Y$, such that $\left\{ U_{\alpha}:\ \alpha\in\cup_{y\in\tilde{Y}}J_{y}\right\} $ covers $X$, then we are done.
For any $y\in Y$, $\cup_{\alpha\in J_{y}}U_{\alpha}$ is an open set in $X$. Hence, $X-\cup_{\alpha\in J_{y}}U_{\alpha}$ is closed. Since $f$ is a closed mapping, we know $Y-f\left(X-\cup_{\alpha\in J_{y}}U_{\alpha}\right)$ is open. Since $y\in Y-f\left(X-\cup_{\alpha\in J_{y}}U_{\alpha}\right)$, there exists a neightbourhood $V_{y}$ of $y$, such that $V_{y}\subset Y-f\left(X-\cup_{\alpha\in J_{y}}U_{\alpha}\right)$. In other words, $f^{-1}\left(V_{y}\right)\subset\cup_{\alpha\in J_{y}}U_{\alpha}$. Since $Y$ is compact, there exists a finite set $\tilde{Y}$ such that $Y\subset\cup_{y\in\tilde{Y}}V_{y}$. Therefore, $$ X=f^{-1}\left(Y\right)\subset f^{-1}\left(\cup_{y\in\tilde{Y}}V_{y}\right)=\cup_{y\in\tilde{Y}}f^{-1}\left(V_{y}\right)\subset\cup_{y\in\tilde{Y}}\left(\cup_{\alpha\in J_{y}}U_{\alpha}\right)=\cup_{\alpha\in J'}U_{\alpha} $$ where $J'=\cup_{y\in\tilde{Y}}J_{y}$ is a finite set. Q.E.D.
[I've read an earlier post (Prob 12, Sec 26 in Munkres' TOPOLOGY, 2nd ed: How to show that the domain of a perfect map is compact if its range is compact?) and the proof therein, but I still cannot get a clue. As a new commer, I cannot leave a comment there.]