Let $A = \{0\} \cup [1,2] \cup \{3\}$ and $ B = [0,1] \cup \{2\} \cup \{3\}$ proof there is no homeomorphism 
Let $A = \{0\} \cup [1,2] \cup \{3\}$ and $ B = [0,1] \cup \{2\} \cup \{3\}$ be subspaces of $\mathbb{R}$ in the usual topology.
Prove that there does not exist a homeomorphism $h:\mathbb{R}\to\mathbb{R}$ taking $A$ to $B$.

I was thinking to use the fact that a side of the interval has 2 points and in the other has one point on both sides.  Maybe then I can use a connected components result, but I can't seem to write a proof.
Thanks for any hints.
 A: Here is a proof from more-or-less basic principles you might have seen.
Lemma 1: If $h:[x,y]\to[\alpha,\beta]$ is a homeomorphism and $h(x)<h(y)$, then for all $x\leq a<b\leq y$ we have $h(a)<h(b)$.
Proof of Lemma 1: Assume to the contrary that $h(b)<h(a)$.  Note that $[x,a]\sqcup[b,y]$ has exactly two components, so by a simple result on homeomorphisms we have that $h([x,a]\sqcup[b,y])=h[x,a]\sqcup h[b,y]$ has exactly two components, namely $h[x,a]$ and $h[b,a]$.  Now
\begin{align*}
[\min\{h(x),h(a)\},\max\{h(x),h(a)\}]&\subseteq h[x,a]&\text{and}\\
[\min\{h(b),h(y)\},\max\{h(b),h(y)\}]&\subseteq h[b,y]
\end{align*}
By our note on the components of $h([x,a]\sqcup[b,y])$ we have that either $\max\{h(b),h(y)\}<\min\{h(x),h(a)\}$ or $\max\{h(x),h(a)\}<\min\{h(b),h(y)\}$.  In the former case
$$h(y)\leq\max\{h(b),h(y)\}<\min\{h(x),h(a)\}\leq h(x)<h(y)$$
which is absurd.  In the latter case we have a similar absurdity:
$$h(a)\leq\max\{h(x),h(a)\}<\min\{h(b),h(y)\}\leq h(b)<h(a)$$
In particular $h(a)\leq h(b)$.  As $h$ is injective we have $h(a)<h(b)$, completing the proof.
Analogously if $h(y)<h(x)$, then for all $x\leq a<b\leq y$ we have $h(b)<h(a)$.
Lemma 2: If $h:[x,y]\to[\alpha,\beta]$ is a homeomorphism and $h(x)\leq h(y)$, then $h(x)=\alpha$ and $h(y)=\beta$.
Proof of Lemma 2: By Lemma 1 we have that $\alpha\leq h(x)\leq h(a)$ for all $x\leq a\leq y$.  As $\alpha=h(c)$ for some $x\leq c\leq y$ by surjectivity, we must have $\alpha\leq h(x)\leq h(c)=\alpha$, so $h(x)=\alpha$.  A similar argument yields $h(y)=\beta$, which concludes the proof.
Analogously if $h(y)\leq h(x)$, then $h(y)=\alpha$ and $h(x)=\beta$.
Proof of Result: Let $h:\mathbb{R}\to\mathbb{R}$ be a homeomorphism.  By a simple result on homeomorphisms we have that $h|_{[0,3]}:[0,3]\to h[0,3]$ is a homeomorphism.  Assume to the contrary that $h(A)=B$. Thus we have $[0,3]\subseteq h[0,3]$, and necessarily $h[1,2]=[0,1]$ and $h(0),h(3)\in\{2,3\}$ as $h$ is bijective and takes path components to path components.  By Lemma 1 either $h(0)<h(1)<h(2)$ or $h(3)<h(2)<h(1)$.  In the first case $h(1)=0$ and $h(2)=1$ by Lemma 2, so either $2=h(0)<h(1)=0$ or $3=h(0)<h(1)=0$; as both of these are absurd, the first case is impossible.  In the second case $h(1)=1$ and $h(2)=0$ by Lemma 2, so either $2=h(3)<h(2)=0$ or $3=h(3)<h(2)=0$; as both of these are absurd, the second case is impossible.  As both cases lead to an absurdity we have that $h(A)\neq B$ by necessity, completing the proof that no such homeomorphism can exist.
A: In a comment on my other answer, I was asked to give a simpler proof using the following lemma.
Lemma A: Every homeomorphism carries path components to path components.
My proof below will also make use of the Intermediate Value Theorem.
Proof of result: Let $X = \{0\} \cup [1, 2] \cup \{3\}$ and $Y = [0, 1] \cup \{2\} \cup \{3\}$.  Assume to the contrary that there is a homeomorphism $f \colon \mathbb{R} \to \mathbb{R}$ such that $f(X) = Y$.  Now $f^{-1}$ is also a homeomorphism, and restricts to homeomorphisms on the path components of $Y$ by Lemma A and the fact that homeomorphisms restrict to homeomorphisms.  In particular, we have $f^{-1}([0, 1]) = [1, 2]$ as these are the only infinite path components of $Y$ and $X$ respectively.  Now $f^{-1}\{2, 3\} = \{0, 3\}$, so by the Intermediate Value Theorem there is a $2 \leq x \leq 3$ such that $f^{-1}(x) = 1$ because $0 \leq 1 \leq 3$.  On the other hand, there is an $x' \in [0, 1]$ with $f^{-1}(x') = 1$ by our previous remark.  Hence $f^{-1}(x) = f^{-1}(x')$ for $x \geq 2 > 1 \geq x'$, so $f^{-1}$ is not injective.  But this implies $f^{-1}$ is not a homeomorphism, which is absurd.  Hence there is no such homeomorphism $f$.
A: If exist a homeomorphism f from $\Bbb{R} to \Bbb{R}$ such that $f(A)=B$ then $A\cong B$ now it is not true because $(A-\{2\})\not\cong (B-\{2\})$ because $A-\{2\}$ has three components connect and $B-\{2\}$ has two components connect and it is contradiction.
