Let $X=[0,1]\cup(2,3]$ and $Y=[0,2]$ with the usual topology. Define $f:X\to Y$ by $$f(x) = \left\lbrace \begin{array}{l} x &\text{ if } x \in[0,1] \\ x-1 &\text{ if } x\in(2,3] \\ \end{array} \right.$$. Prove bijetivity and continuity of $f$, prove that $f^{-1}$ is not continuous.
This is one of the exercises I'm currently trying to solve. I'll post what I did by parts:
$(1)$ Proving that $f$ is injective
I believe this one should be fairly simple since $f(x)$ is either in $[0,1]$ or $(1,2]$ depending of the value of $x$. Suppose that $f(x_1)=f(x_2)$, then if $f(x_1)=f(x_2)\in[0,1]$ follows from definition of $f$ that $x_1=x_2$; if $f(x_1)=f(x_2) \in(0,2]$ follows that $x_1-1=x_2-1 \implies x_1=x_2$.
$(2)$ Proving that $f$ is surjective
From the definiton of $f$ seems easy to define $f^{-1}$. Maybe defining $f^{-1}:[0,2]\to X$ by $$f^{-1}(x)=\left\lbrace \begin{array}{l} x &\text{ if } x\in[0,1]\\ x+1 &\text{ if } x\in(1,2] \\ \end{array} \right.$$ could work. Now for any $x\in Y$ we have $f(f^{-1}(x))=x$, so $f$ is surjective.
$(3)$ Proving $f$ continuous and $f^{-1}$ discontinuous
Here I'm having some issues, particularly because I believe the exercise is wrong and the former claim is not true.
For instance, if $f$ were continuous I could take an open set $A\subset Y$ and $f^{-1}(A)$ should be open, but can this be true for any set that includes $1$?. For example, let's take $A=(1/2,3/2)$, then $f^{-1}(A)=(1/2,1]\cup(2,5/2]$, which doesn't seem to be open.
How could I prove is not open in the usual topology?, I believe it would be enough to point out that any open neighborhood around $1$ contains points of $A$ and points of the exterior of $A$, then $1$ is not interior to $A$ and follows $A$ not open. Or maybe I'm being deceived by the splited-looks of the set?, and since $A$ should be open in $X$ and there is no $X$ between $1$ and $2$ I cannot say that $1$ is a boundary point?. Still remains the problem of how to prove this for any set that contains $1$.
And for $f^{-1}$, looks like I could take an open set $A_1\subset[0,1]$ or $A_2\subset(2,3]$ and the set $A_1$ would be open in $[0,1]_Y$ and $A_2$ would be open in $(1,2]_Y$ so $f^{-1}$ looks continous.