This is an exam question that i am having trouble with. I tried to show that $f$ is a closed map, but without the assumption of surjectivity i could not prove my claim of closedness. Also i wanted to use the Lebesgue Number lemma to get the $\delta >0$ in an open cover of $Y$, but this lemma only hold for a compact metric space. How can i approach the problem? Any hint(s) will be highly appreciated. Thank you.
Suppose that $C$ is a closed subset of $X$. Then $C$ is compact, and $f$ is continuous, so $f[C]$ is compact. Finally, $Y$ is Hausdorff (since it’s metric), so compact subsets of $Y$ are closed, and $f[C]$ is therefore closed. Thus, $f$ is a closed map.
Note that you can replace $Y$ by $f[X]$, which is a compact metric space.