It is very common to find in calculus textbooks the following theorem: if the functions $f$ and $g$ are continuous at $x_0$, then the composite function $f\circ g$ function is also continuous at $x_0$.
So, as we know that $f\circ f^{-1}=x$, can it be concluded that $f^{-1}$ has to be continuous?
It can be proved that if $I$ is an interval of $\mathbb R$ and if $f\colon I\longrightarrow\mathbb R$ is injective, then $f^{-1}\colon f(I)\longrightarrow I$ is continuous. But this is false if, instead of an interval, $I$ is an arbitrary subset of $\mathbb R$.