Claim : let $f: A \subseteq \mathbb{R} \to \mathbb{R}$ is a real valued function on $A$
and $D \subseteq{A}$ , function $f$ is continuous on $D$ , one-to-one.
let $E=f(D)$ then : $f^{-1} :E \to D$ is continuous .
is it right ?Or should $D$ is compact. ?
Hint : Consider : $$ f(x) = \begin{cases} x & \text{if } x \in[0,1)\\ 2-x & \text{if } x \in(2,3] \end{cases}$$
$f$ is continuous and one to one on $[0,1)\cup(2,3]$ but you can prove that $f^{-1}$ is not continuous.