I want to show that a compact metric space is a separable space.
Attempt: Suppose $X$ is compact. Then it is complete and totally bounded. Taking $\epsilon=\frac{1}{n}$ in the definition of total boundedness gives me $\exists x_1,x_2,\ldots,$ such that $X\subset \bigcup_{i=1}^nB_{\frac{1}{n}}(x_i)$..
how to continue?
If $X$ is compact, there are points $\{x_i^{(n)}\}_{i=1}^{k_n}$ for all $n \in \mathbb N$ and finite $k_n$, such that $$ X \subset \bigcup_{i=1}^{k_n} B(x_i,1/n) \qquad (n \in \mathbb N) $$ Now take the union of all the $x_i^{(n)}$ to get a countable dense subset of $X$.