Homeomorphism from the real numbers to the real numbers with restriction to the Cantor set. Let $K$ be the Cantor set and $C \subset R$ be a non empty compact set with no isolated points and empty interior. Prove that it exists a homeomorphism $f:R \longrightarrow R$ such that $f(K)= C$.
 A: Let $U=\mathbb{R}\setminus C$ and let $S$ be the set of connected components of $U$.  Then $S$ is a set of disjoint open intervals (in particular, it is necessarily countable) and we can totally order $S$ by saying $s< t$ if every element of $s$ is less than every element of $t$ for $s,t\in S$.  Since $C$ is compact and thus bounded, $S$ has a greatest and least element.  Moreover, for any $s,t\in S$ with $s<t$, there is $u\in S$ with $s<u<t$.  Indeed, if no such $u$ existed, then $C$ would contain the entire (possibly degenerate) closed interval $I$ of numbers that are greater than every element of $s$ and less than every element of $t$.  If $I$ is degenerate this would mean $C$ has an isolated point, and if $I$ is nondegenerate this would mean $C$ has nonempty interior.
So, $S$ is a countable densely ordered set with greatest and least elements.  By a back-and-forth argument, any two such ordered sets are isomorphic.  In particular, if we let $V=\mathbb{R}\setminus K$ and $T$ be the set of connected components of $V$, then there is an order-isomorphism $g:T\to S$.  Choosing an order-isomorphism between $t$ and $g(t)$ for each $t\in T$ (since $t$ and $g(t)$ are both just open intervals), we can then obtain an order-isomorphism $h:V\to U$.  This order-isomorphism $h$ then extends to the Dedekind completions of $V$ and $U$, which are naturally identified with $\mathbb{R}$ since $V$ and $U$ are each dense in $\mathbb{R}$.  That is, $h$ extends to an order-isomorphism $f:\mathbb{R}\to\mathbb{R}$.  This $f$ is then a homeomorphism that maps $K$ to $C$, as desired.
