Prob 12, Sec 26 in Munkres' TOPOLOGY, 2nd ed: Why we need continuity to show the result? 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.]
 A: It seems, you're right. I think your proof is valid and continuity is not needed for this proof of Munkres Problem number 12 in section 26 Connectedness and Compactness.

In fact, this was already discussed by some other people.

*

*A nice presentation of a proof already arguing that continuity is not necessary for a proof is given by Vadim@dbFin at Munkres: Section 26


*You already pointed to this related MSE question  in your question.


*There is another MSE question presenting a proof of the problem and  also asking if continuity is needed. @DanielFischer also provided  a clear answer to this question.

Note: Let's have a look at the precise formulation of the problem. In my version of Munkres Topology (edition 2) it is stated as

12. Let $\rho:X\rightarrow Y$ be a closed continuous surjective map such that $\rho^{-1}(\{y\})$ is compact, for each $y\in Y$. (Such a map is called a perfect map.) Show that if $Y$ is compact, then $X$ is compact.

It seems, that Munkres also had the technical term perfect map in mind. Otherwise he wouldn't have written it in boldface style.
So, let's have a look at the definition of perfect map:

Definition: Let $X$ and $Y$ be topological spaces and let $p$ be a map from $X$ to $Y$ that is continuous, closed, surjective and such that $p^{-1}(y)$ is compact relative to $X$ for each $y$ in $Y$. Then $p$ is known as a perfect map.

We observe, that continuity is a necessary property of a perfect map. And the first example at this Wiki-page is

If $p : X\rightarrow Y$ is a perfect map and $Y$ is compact, then $X$ is compact.

This does not imply, of course that continuity is necessary. For this example of perfect maps continuity is just a by-product. So, maybe Munkres has thought in terms of perfect maps and this was the reason to include continuity in his problem.
