Rudin's PMA: Exercise 2.24 I have some difficulties solving the following exercise (Rudin's Principles of Mathematical Analysis (PMA), 2.24)
Let $ X $ be a metric space in which every infinite subset has a limit point.
Prove that $ X $ is separable.
In order to solve this I try to find a connected set which contains an
infinite subset that has no limit point.
So, the interval $ [0 \dots 1] $ is a connected set, but it is a compact one also.
According to PMA's theorem 2.37 any infinte subset $E$ of a compact set $K$
has a limit point in $K$.
It appears that I can't find a subset to contradict exercise 2.24.
I know that there is a hint in the book, I try not to read it.
Thnks
 A: Fix $\delta > 0$.
Choose $x_1 \in X $.
Choose $x_2$ such that $d(x_1,x_2)>\delta$.
Now choose $x_3$ such that $d(x_1,x_3)>\delta$ and $d(x_2,x_3)>\delta$.
Continue this process...
Basically, we want to cover $X$ with disjoint $\delta$ balls.
Since, {$x_1, x_2, \dots$} forms and infinite set and clearly does not have a limit $\implies$ finitely many $\delta$ balls around $x_i$'s are enough to cover the whole $X$.
Choose $\delta = 1$.
Then $\exists$ finitely many points {$x_{11},x_{12}, \dots , x_{1N_1}$} such that X can be covered by $\delta$ balls around them.
Similarly for $\delta = \frac{1}{2}$, let the set be {$x_{21},x_{22}, \dots , x_{2N_2}$}.
Repeating this process for $n \in \mathbb{N}$, $\delta = \frac{1}{n}$, let the set be {$x_{N1},x_{n2}, \dots , x_{nN_n}$}.
Construct a set $A=$ {$x_{11},x_{12},\dots,x_{1N_1}, x_{21},x_{22},\dots x_{2N_2},\dots,x_{n1},\dots,x_{nN_n},\dots$}.
Claim: A is countable and dense in X.
Countable is easy. For denseness, use Archimedean Property.
For any $x \in X$, the $\epsilon$ ball around $x$ contains a point from $A$.
Since A is a countable dense subset of $X \implies X$ is separable. 
A: The given property of $X$ (separated because of $d(x,y)=0 \iff x=y$ sometimes called axiom of separation since ensuring the uniqueness of limits) implies that all sequence contains a convergent subsequence so this space $X$ is sequentially compact then compact (and separated because metric).
NOTE.- For french mathematicians, compact is always separated.
Therefore $X$ is a second-countable space (a.i. X admits a countable basis of open sets). We prouve that this fact implies separability of $X$.
Let {$O_n: n\in \mathbb N$} be a countable basis of X and in each $O_n$ choose a point $a_n$; the set, noted A, of all of these $a_n$ is obviously countable and it remains to prove it is dense .
Let $x\in X$ and $O$ an open containing $x$; $O$ is an union of sets $O_n$ and there exist at least un $O_{n_0}$ with $x\in O_{n_0}\subset O$ thus a point $a_n$ belongs to $O$ which shows $A$ is dense.
A: We follow the hints in the textbook.
Claim 1: For each $\delta>0$, there exists a finite set $A_{\delta}\subseteq X$
such that $X=\cup_{x\in A_{\delta}}B(x,\delta),$where $B(x,\delta)=\{y\in X\mid d(x,y)<\delta\}$,
the open ball centered at $x$ with radius $\delta$.
Proof of Claim 1: Fix $\delta>0$. If $X=\emptyset$, we set $A_{\delta}=\emptyset$
and we are done. Suppose that $X\neq\emptyset$. Choose $x_{1}\in X$.
If there does not exist $x\in X$ such that $d(x_{1},x)\geq\delta$,
we stop and define $A_{\delta}=\{x_1\}$. If there exists such $x$, we choose
anyone of them and denote it by $x_{2}$. Suppose that $x_{1},x_{2},\ldots,x_{n}$
have been chosen. If there exists $x\in X$ such that $d(x,x_{k})\geq\delta$
for $k=1,\ldots,n$, we choose anyone of them and denote it by $x_{n+1}$.
We prove by contradiction that this procedure stops at certain step.
For, if not, then we obtain a sequence $(x_{n})$ in $X$ (Here, we
implicitly invoke the Axiom of Countable Choice). Note that $d(x_{i},x_{j})\geq\delta$
whenever $i\neq j$, so $\{x_{n}\mid n\in\mathbb{N}\}$ is an infinite
set. (We distinguish between a set $\{x_{n}\mid n\in\mathbb{N}\}$
and a sequence $(x_{n})$. By a sequence $x=(x_{n})$, it is a function
$x:\mathbb{N}\rightarrow X$. Note that the set $\{x_{n}\mid n\in\mathbb{N}\}$
is the range $x[\mathbb{N}]$ of the sequence $x$ (I also distinguish between co-domain and range of a function, i.e., the
range of a function equals to the co-domain iff the function is surjective.)).
By assumption, $\{x_{n}\mid n\in\mathbb{N}\}$ has a limit point
$y\in X$. Choose $i$ such that $0<d(y,x_{i})<\delta/2$. For $\delta'=\frac{1}{2}d(y,x_{i})>0$,
there exists $j$ such that $0<d(y,x_{j})<\delta'$. Note that $i\neq j$,
otherwise, we will have $d(y,x_{j})<\delta'=\frac{1}{2}d(y,x_{i})=\frac{1}{2}d(y,x_{j}),$
which is a contradiction because $d(y,x_{j})>0$. Finally, $d(x_{i},x_{j})\leq d(x_{i},y)+d(y,x_{j})<\delta/2+\frac{1}{2}d(y,x_{i})<\delta$,
contradicting to the condition $d(x_{i},x_{j})\geq\delta$ whenever
$i\neq j$. Suppose that the procedure stops at $n$ and we obtain
$x_{1},\ldots,x_{n}$. Let $A_{\delta}=\{x_{i}\mid1\leq i\leq n\}$.
That the procedure cannot be proceeded implies that $\forall x\in X\,\exists k\in\{1,\ldots,n\}\,d(x,x_{k})<\delta.$
Hence, $X=\cup_{x\in A_{\delta}}B(x,\delta).$

For each $n\in\mathbb{N}$, we fix a choice $A_{\frac{1}{n}}$ as
in Claim 1. Define $A=\cup_{n=1}^{\infty}A_{\frac{1}{n}}$, which
is a countable set because each $A_{\frac{1}{n}}$ is a finite set.
Let $x\in X$ and $\varepsilon>0$ be arbitrary. Choose $n$ such
that $\frac{1}{n}<\varepsilon$. Since $X=\cup_{y\in A_{\frac{1}{n}}}B(y,\frac{1}{n}),$
there exists $y\in A_{\frac{1}{n}}\subseteq A$ such that $d(x,y)<\frac{1}{n}<\varepsilon$.
Therefore, $A$ is a countable dense subset of $X$.
