The image of a second-countable space by a closed continuous mapping with compact fibers is second-countable I don't know to solve this exercise:  

Let $f : X → Y$ be a continuous, closed and onto map such that $f^{−1}(y)$ is compact for every $y ∈ Y$ . Prove that $Y$ has a countable basis if $X$ has a countable basis. 

I have no idea. I know only that $f$ is an identification. How can I solve ? 
 A: Fix a countable base $\mathcal B = \{ U_n : n \in \mathbb N \}$ for $X$. Note that without loss of generality we may assume that $\mathcal B$ is closed under finite unions (i.e., if $n_1 , \ldots , n_k \in \mathbb N$, then there is an $n$ such that $U_{n_1} \cup \cdots \cup U_{n_k} = U_n$).


*

*If $\mathcal B$ is countable, then so is the set of all finite subsets of $\mathcal B$, call it $\operatorname{fin} \mathcal B$. Then $\mathcal B^* = \{ \bigcup \mathcal A : \mathcal A \in \operatorname{fin} \mathcal B \}$ is a collection of open subsets of $X$, is closed under finite unions, and is still countable (since $\operatorname{fin} \mathcal B$ is). Also, since $\mathcal B \subseteq \mathcal B^*$, it follows that $\mathcal B^*$ is also a base for $X$.


For each $n \in \mathbb N$ define $$V_n = Y \setminus f [ X \setminus U_n ].$$ Note that since $f$ is a closed mapping each $V_n$ is open in $Y$. We will show that $\mathcal D = \{ V_n : n \in \mathbb N \}$ is a base for $Y$.
Let $W \subseteq Y$ be open, and let $y \in W$. Since $f^{-1} \{ y \} \subseteq f^{-1} [ W ]$ and $f^{-1} [ W ]$ is open by continuity, for each $x \in f^{-1} \{ y \}$ there is an $n_x \in \mathbb N$ such that $x \in U_{n_x} \subseteq f^{-1} [ W ]$. Thus $\{ U_{n_x} : x \in f^{-1} \{ y  \} \}$ is an open cover of $f^{-1} \{ y \}$, so by compactness there are $x_1 , \ldots , x_k \in f^{-1} \{ y \}$ such that $f^{-1} \{ y \} \subseteq U_{x_1} \cup \cdots \cup U_{x_n}$. By the closure properties of $\mathcal B$ there is an $n \in \mathbb N$ such that $U_n = U_{x_1} \cup \cdots \cup U_{x_k}$.
Note, too, that $U_n \subseteq f^{-1} [ W ]$. Taking advantage that $f$ is a surjection, we can show that $V_n = Y \setminus f [ X \setminus U_n ] \subseteq W$. Similarly, that $f^{-1} \{ y \} \subseteq U_n$ can be used to show that $y \in V_n$.
Therefore $\mathcal D$ is a base for $Y$, and it is clearly countable.
A: Let $\mathcal{B}$ be a countable base for $X$.
We can assume that $\mathcal{B}$ is closed under finite unions (just add all finite unions, of which there are only countably many, using a standard closure argument).
For every $B \in \mathcal{B}$ define $V(B) = Y \setminus f[X \setminus B]$ which is open in $Y$ as $f$ is a closed map.
Then this is a base for $Y$:
suppose $O$ is open in $Y$ and $y \in O$. Then $f^{-1}[\{y\}] \subseteq O$ and so there are finitely many base members $B_1, \ldots, B_n$ such that $f^{-1}[\{y\}] \subseteq B_1 \cup \ldots B_n \subseteq O$ (this uses compactness of the fibres, we have such a $B_x$ for every $x \in f^{-1}[\{y\}]$, and then take a finite subcover). As our countable base is closed under finite unions, $B = \cup_{i=1}^n B_i \in \mathcal{B}$ and this obeys
$$f^{-1}[\{y\}] \subseteq B \subseteq f^{-1}[O]$$
But then $$ y \in V(B)$$ 
(suppose $y \notin V(B)$, then $y \in f[X \setminus B]$, so there is some $x \in X \setminus B$ with $f(x) = y$. But then $x \in f^{-1}[\{y\}]$ while $x \notin B$, contradicting $f^{-1}[\{y\}] \subseteq B$, so $y \in V(B)$) and also 
$$f^{-1}[V(B)] \subseteq B$$ 
(suppose $x \in f^{-1}[V(B)]$, so $f(x) \in V(B)$ and suppose $x \notin B$, then $f(x) \in f[X \setminus B]$ and so $f(x) \notin V(B)$ contradiction, so $x \in B$ as required).
Surjectivity of $f$ then also gives $V(B) \subseteq O$: if $y' \in V(B)$ there is some $x' \in X$ with $f(x') = y'$. Then $x' \in f^{-1}[V(B)]$ so $x' \in B$ by the previous, and we already know that $B \subseteq f^{-1}[O]$, so $y' = f(x') \in O$ as required. 
So $\{V(B): B \in \mathcal{B}\}$ is a countable open base for $Y$.
