compactness in metric spaces Let $f: X \to Y$ be a continuous, closed function where $X$ and $Y$ are metric spaces. Show that if for every $y \in Y$, the set $f^{-1}(y)$ is compact, then for each compact set $F \in Y$, the set $f^{-1}(F)$ is compact.
 A: Suppose $\mathcal{U} = \{U_i : i \in I \}$ is an open cover of $f^{-1}[F]$, where $F$ is compact in $Y$.
Then for each $y \in F$, this is also an open cover of the compact set $F_y := f^{-1}[\{y\}]$, so there are finitely many elements from $\mathcal{U}$ that cover $F_y$, i.e. there is a finite subset $I(y) \subset I$ such that 
$$F_y = f^{-1}[\{y\}] \subset \cup_{i \in I(y)} U_i\text{.}$$
For each $y \in F$ we now define $$V_y = Y \setminus f[X \setminus \cup_{i \in I(y)} U_i]\text{.}$$  
All sets $V_y$ are open, as the complement of closed sets. Here we use that $f$ is a closed function and we are taking the image of a closed set on the right hand side.
Also for all $y \in F$, $y \in V_y$. This holds as all $x$ that map to $y$ under $f$ (i.e. $F_y$) are in $\cup_{i \in I(y)} U_i$, so $y$ cannot be in $f[X \setminus \cup_{i \in I(y)} U_i]$ and so is in $V_y$.
As $F$ is compact, finitely many $V_y$, say $V_{y_1},\ldots,V_{y_m}$ cover $F$. Define $I' = \cup_{j=1}^m I(y_j)$, which is a finite union of finite sets, so finite. Claim: $\{U_i: i \in I'\}$ already cover $f^{-1}[F]$: let $x \in f^{-1}[F]$, then $f(x) \in V_{y_k}$ for some $k \in \{1,\ldots,m\}$. Then $x$ must be in $\cup_{i \in I(y_k)} U_i$, or else $f(x) \in f[X \setminus \cup_{i \in I(y_k)} U_i] = Y \setminus V_{y_k}$, which is not the case. This means $x$ is indeed covered by some $U_i$ with $i \in I'$.
Note that the continuity of $f$ is not required.
