So, here's the theorem
Theorem 2.34 Compact subsets of a metric space are closed.
Proof.
Suppose $K\subseteq X$, $K$ compact. Let $p\in K^c$, $q\in K$. Let $V_q,W_q$ be neighborhoods of $p$ and $q$ with radius less than $\frac 1 2 d(p,q)$.
Since $K$ is compact, we have $K\subseteq W_{q_1}\cup \cdots\cup W_{q_n}=W$ for some $q_1,...,q_n\in K$.
If V=$V_{q_1}\cap \cdots V_{q_n}$, $V$ is a neighborhood of p which does not intersect $W$, then $V\subseteq K^c$ so $p$ is an interior point of $K^c$. QED.
I'm not seeing how compactness is relevant here. We only need there to be a finite set of q's such their neighborhoods cover K. But this doesn't mean K is compact: there might be an open cover with no finite subcover. (Actually, isn't there always a finite cover? Just take an open set that includes the set you want to cover)
Could you clarify? Thanks!
Compactness is needed for this line in the proof:
Decomposing this line, what Rudin did was consider the (way too big) collection $\{W_q:q\in K\}$ and then note that this formed a (possibly uncountable) open cover of $K$. But $K$ is compact, thus there must be some finite subcollection which he called $\{W_{q_1},\ldots,W_{q_2}\}$ which still covers $K$.
In particular, note that compactness guarantees that every cover has a finite subcover. If the "every" bit wasn't given, then we would not be able to say that the arbitrarily picked collection $\{W_q:q\in K\}$ has such a finite subcover!