Proof from http://en.wikipedia.org/wiki/Heine-Borel_theorem:
'''If a set is compact, then it must be closed.'''
Let $S$ be a subset of $\mathbb{R}^n$. Observe first the following: if $a$ is a limit point of $S$, then any finite collection $C$ of open sets, such that each open set $U \in C$ is disjoint from some neighborhood $V_U$ of $a$, fails to be a cover of $S$. Indeed, the intersection of the finite family of sets $V_U$ is a neighborhood $W$ of $a$ in $\mathbb{R}^n$. Since $a$ is a limit point of $S$, $W$ must contain a point $x$ in $S$. This $x$ ∈ $S$ is not covered by the family $C$, because every $U$ in $C$ is disjoint from $V_U$ and hence disjoint from $W$, which contains $x$.
If $S$ is compact but not closed, then it has an accumulation point $a$ not in $S$. Consider a collection $C’$ consisting of an open neighborhood $N(x)$ for each $x \in S$, chosen small enough to not intersect some neighborhood $V_x$ of $a$. Then $C’$ is an open cover of $S$, but any finite subcollection of $C’$ has the form of $C$ discussed previously, and thus cannot be an open subcover of $S$. This contradicts the compactness of $S$. Hence, every accumulation point of $S$ is in $S$, so $S$ is closed.
Two lingering questions about this proof:
Why must the set $C$ in the first paragraph be finite? Shouldn't it be true for all $C$ whether or not it's finite?
And in the second paragraph, why is $C’$ an open cover but any finite subcollection of $C’$ is not an open subcover? There must be some fundamental difference I’m missing in my current thinking: If $C’$ always excludes some neighborhood $V_x$ of $a$ for all $x$, then even the infinite collection of $C’$ should not be an open cover!
Take the interval $(0,1]$, and the infinite cover consisting of the intervals $(\frac1n,1]$. The whole interval is covered, but no finite subset covers the interval. Since I've just given you an open cover with no finite subcover, $(0,1]$ is not compact.
In this context, $a=0$ and $C' = \{(\frac1n,1]\mid n\in \Bbb Z\}$ (note how $a$ is not an element of $S$). I hope it illustrates how an infinite cover where each open set misses a neighbourhood of an accumulation point, still can cover the whole set.
In the first paragraph, $C$ must be finite since what we've proven is that the union of the sets in $C$ is disjoint from the intersection of the neighbourhoods $V_U$. This is only guaranteed to be open if it is a finite intersection.