Find a compact, totally disconnected subset of $\mathbb{R}$ which is not a finite set. 
Find a compact, totally disconnected subset of $\mathbb{R}$ which is
  not a finite set.

I am trying to solve this problem, but I don't see how this could be possible. If finiteness wasn't a condition I would just say a couple of point on $\mathbb{R}$ but with that condition the only sets that I can think of are the integers, rationals, irrationals and their subsets. But none of these satisfy both of the conditions.
 A: Hint: Find an open set $U$ containing the rationals whose measure is less than $1/2.$ Then look at $[0,1]\setminus U.$
A: A classic example would be the Cantor Set, which you can read about here: wikipedia article on the Cantor Set.
One way to define the Cantor Set, is to build a sequence of sets $X_0,X_1,X_2,\ldots$, and then define the Cantor Set to be
$$C=\bigcap_{n=o}^{\infty}X_n.$$
Each $X_i$ will be union of intervals. To start, we let $X_0=[0,1]$, and then at each step, we form $X_{n+1}$ by removing the middle thirds of the intervals in $X_n$. For example,
$$X_1=\left[0,\frac{1}{3}\right]\cup\left[\frac{2}{3},1\right],$$
$$X_2=\left[0,\frac{1}{9}\right]\cup\left[\frac{2}{9},\frac{1}{3}\right]\cup\left[\frac{2}{3},\frac{7}{9}\right]\cup\left[\frac{8}{9},\frac{1}{3}\right],$$
Etc.
Another way to form the Cantor Set is to work in base three. In base three, $2+1=10$ and $\dfrac{1}{2+1}=0.1$. The Cantor Set is all the real numbers between $0$ and $1$ that have a base three expansion where the digit one does not appear. Note that this includes $1$, since $1=0.\overline{2}=0.222.\ldots$
It can be shown that the Cantor Set is compact, totally disconnected, and has the same cardinality as the reals. Since each of these is a good exercise, I've hidden the proofs below.
Here's a proof that the Cantor Set is compact:

 First, note that the Cantor Set is bounded. Also, note that each set $X_i$ is closed, so that $C$ is an intersection of closed sets, and is therefore closed. So the Cantor Set is a closed and bounded subset of $\Bbb{R}$ and is therefore compact.

Here's a proof that the Cantor Set is uncountable:

 Note that the Cantor Set $C$ is the set of elements of $[0,1]$ with a base three expansion that does not contain the digit $1$. The only real numbers that do not have a unique base three expansion are the rational numbers of the form $\dfrac{n}{3^k}$, where $n,k\in\Bbb{Z}$ with $k\ge0$. These rationals will have exactly two base three expansions: one that ends in a trail of zeroes, and one that ends in a trail of twos. However, at least one of these expansions will contain a $1$. It follows that each element of the Cantor Set has a unique base three expansion that does not include the digit $1$. Hence there is a bijection between the Cantor Set, and the set of sequences $a_1,a_2,a_3,\ldots$ with each $a_i$ equal to $0$ or $2$. This latter set is uncountable, and in fact, has the same cardinality as $\Bbb{R}$.

Here's a proof that the Cantor Set is totally disconnected:

 It is enough to show that for every $x,y\in C$ with $x<y$, there is $z\notin C$ with $x<z<y$. If we look at the base three expansions of $x$ and $y$ we have that $$x=0.x_1x_2x_3.\ldots$$ and $$y=0.y_1y_2y_3.\ldots$$ where each $x_i$, $y_i$ is either $0$ or $2$. Since $x<y$, there is a smallest $n$ for which $x_n\ne y_n$. It follows that $x_n=0$ and $y_n=2$. Hence $$x=0.x_1x_2\ldots x_{n-1}0x_{n+1}x_{n+1}\ldots\le0.x_1x_2\ldots x_{n-1}1,$$ and $$y=0.x_1x_2\ldots x_{n-1}2y_{n+1}y_{n+1}\ldots\ge0.x_1x_2\ldots x_{n-1}2.$$ So if we let $$z=0.x_1x_2\ldots x_{n-1}\overline{1}=0.x_1x_2\ldots x_{n-1}111\ldots$$ then $x<z<y$ and $z\notin C$.

If you have any question about the above proofs, please post a comment!
