TITLE: Prove that every compact metric space is separable
QUESTION [15 upvotes]: I'm in high school and self-studying analysis. I completed this proof for a problem in Rudin, but wanted some verification. Does this look correct? 
Proof that every compact metric space $K$ has a countable base and is therefore separable: 
Consider $p \in K$ with an arbitrary $\epsilon > 0.$ By the Archemedian Principle, there exists a natural number $n$ such that $\frac{1}{n} < \epsilon.$
Consider the open cover $$K \subset \bigcup_{i \in K} N_{\frac{1}{n}}(i).$$ Since $K$ is compact, there exists a finite subcover $$K \subset \bigcup_{i \in X_n} N_{\frac{1}{n}}(i),$$ where $X_n = \{x_{1_n}, x_{2_n}, x_{3_n}, ... x_{j_n}\} \subset K$ for some $j_n \in \mathbf{N}.$ 
Since $p \in K$, $p \in N_{\frac{1}{n}}(x_{i_n})$ for some $x_{i_n} \in X_n$. 
This means that $d(p, x_{i_n}) \leq \frac{1}{n}$, which also implies that $x_{i_n} \in N_\frac{1}{n}(p) \subset N_{\epsilon}(p),$ so $x_{i_n} \in N_{\epsilon}(p).$
Since $x_{i_n}$ is a member of $X_n$, $N_{\epsilon}(p)$ thus intersects the finite subset $X_n$. 
As the choices for $p \in K$ and $\epsilon$ were arbitrary, any neighborhood around every point in $K$ must intersect a countable subset $X$. 
By definition of closure of a set, $K \subset$ cl$(X)$.  This means that $X$ is dense in $K$ and thus forms a countable base. 
Therefore $K$ is separable.

REPLY [6 votes]: $X_n = \{x_{1_n}, x_{2_n}, x_{3_n}, ... x_{j_n}\} \subset K$

This should say something like $X_n = \{x_{1,n},\dots,x_{j_n,n}\}$. Writing $1_n$ and $2_n$ and so on doesn't make sense. We put subscripts on variables, not numbers.
This bit doesn't make sense:

As the choices for $p \in K$ and $\varepsilon$ were arbitrary, any neighborhood around every point in $K$ must intersect a countable subset $X$.

What is $X$? Does it depend on $p$? on $\varepsilon$? Maybe you mean to say that $X = \bigcup_{n \ge 1} X_n$ but then you've defined $n$ based on $\varepsilon$ when you shouldn't have.
You also seem to be confusing "countable base" for "countable dense set" when these are different things. A countable base is a countable collection $B$ of open sets such that every open set can be written as a union of sets in $B$. For instance $B = \{(a, b) : a < b \text{ and } a, b \in \mathbf{Q} \}$ is a countable base for the topology of $\mathbf{R}$.
What you will have are sets $X_n = \{x_{1,n},\dots,x_{j_n,n}\}$ such that
$$ K = \bigcup_{i = 1}^{j_n} N_{1/n}(x_{i,n}). $$
Then
$$ B = \{ N_{1/n}(x_{i,n}) : n \in \mathbf{N}, 1 \le i \le j_n \} $$
is a countable base and
$$ X = \{ x_{i,n} : n \in \mathbf{N}, 1 \le i \le j_n \} $$
is a countable dense set.