The statement is trivial if
\(I\) is degenerated so let us assume
\(I\) has at least two points. Since
\(f\) is continuous and injective on an interval
\(I\text{,}\) it is strictly monotone on
\(I\text{,}\) say
\(f\) is strictly increasing on
\(I\) and hence so is its inverse
\(g \colon f(I) \to I\text{.}\) So if
\(g\) were discontinuous at some
\(y_0 \in J:=f(I)\) then at least one of
\(g(y_0^-)\) and
\(g(y_0^+)\) must differ from
\(g(y_0)\text{.}\) Without loss of generality,
\(g(y_0^-)\text{,}\) which is the supremum of the set
\(\{g(y) \colon y \in J, y \lt
y_0\}\text{,}\) is strictly less than
\(g(y_0)\text{.}\) From this, it is easy to see that
\(g(y_0^-) \in I\) and so must
\(x ':=
(g(y_0^-)+g(y_0))/2\text{.}\) We then have
\(y' \in J, y' \lt y_0\) with
\(g(y') = x'\) contradicting the fact that
\(g(y_0^-)\) is the supreme of
\(g(J \cap (-\infty,y_0))\text{.}\)