Give a function $f : X \to Y$ such that $(X,d)$ and $(Y,p)$ are metric spaces, and $f$ is continues and one-to-one function and onto $Y$ but $f^{-1}$ is not continues ?
I know that compactness of $X$ must play a role here, because if $X$ is compact then there is no such counter-example, so $X$ must be no compact, but other than this i don't have a direction for the solution, please help.
If $X:=(\mathbb{R},d)$ where $d(x,y)=1$ for all $x,\ y$ and $Y:=(\mathbb{R},|\ |)$ where $|\ |$ is a canonical metric, then $f=id: X\rightarrow Y$ is continuous. But $f^{-1}(1/n) = 1/n$ does not converge to $0$