Let $f:E\to F$ where $E$ and $F$ are metric space. We suppose $f$ continuous. I know that if $I\subset E$ is compact, then $f(I)$ is also compact. But if $J\subset F$ is compact, do we also have that $f^{-1}(J)$ is compact ?
If yes and if $E$ and $F$ are not necessarily compact, it still works ?
Not necessarily; consider $f:(-2\pi,2\pi)\to[-1,1]$ given by $f(x)=\sin(x)$.