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.