Is the inverse of a continuous bijective function also continuous? [duplicate]

Is the inverse of a continuous bijective function also continuous? How to prove it?


Take the function $f(x)=x^2$ for $x\in(-1,0]\cup[1,2]$. Then $f:(-1,0]\cup[1,2]\to[0,4]$ is continuous and bijective, but the inverse is not continuous. We can see the inverse is not continuous since $[0,4]$ is connected but $(-1,0]\cup[1,2]$ is not connected.


Take any set $S$. Let $X$ be $S$ with the discrete topology and $Y$ be $S$ with the coarse topology. Note that the identity $i:X\to Y$ is continuous, but its inverse, the identity $i:Y\to X$, is not.