Theorem $4.17$
Suppose $f$ is a continuous 1-1 mapping of a compact metric space $X$ onto a metric space $Y$. Then the inverse mapping $f^{-1}$ defined on $Y$ by $$f^{-1}(f(x)) = x (x \in X)$$ is a continuous mapping of $Y$ onto $X$.
I'm interested in the compact sets of $\mathbb R$ of the form $[a,b]$ .
Is the following equivalence true:
Theorem $4.17$ applied to $X= [a,b]$ $\iff$ theorem $(T)$ $\tag{1}$
Where theorem $(T)$ states as follows:
Theorem $(T)$
Suppose $f$ is a continuous 1-1 mapping on $X=(a,b)$ onto a metric space $Y$. Then the inverse mapping $f^{-1}$ defined on $Y$ by $$f^{-1}(f(x)) = x (x \in X)$$ is a continuous mapping of $Y$ onto $X$.
?
Taking the restriction of $f$ to $[a',b']$ (where $a'>a$ and $b'<b$ ) gives $\implies$ of $(1)$. I'm not sure of the other way of the equivalence.
EDIT (reply to Paul Frost's comment):
Here is what I think a "zoom" on $(0,0)$ of the image of the function looks like:

It is not true. Take $$F : (-2\pi, 2\pi)\to \mathbb R^2, F(t) = \begin{cases} (\cos t - 1, \sin t) & t \le 0 \\ (1 -\cos t, \sin t) & t \ge 0 \end{cases}$$ The image of $F$ is the union $E$ of two circles with radius $1$ and centers $(-1,0)$ and $(1,0)$ (a "lying figure eight"). It is easy to verify that $F$ is injective. Thus $$f : (-2\pi, 2\pi) \xrightarrow{F} E$$ is a continuous bijection. Since $E$ is compact, $f^{-1}$ cannot be continuous (in that case $(-2\pi, 2\pi)$ would be compact).