Why does this proof of "compact subsets of $\Bbb R$ are closed" fail for a non-Hausdorff space? The following is a proof that "a compact set is closed in $\Bbb R$" from my real analysis course material. I just learned this is necessarily true for non-Hausdorff general topological spaces. Can someone point out why this kind of proof might fail for a non-Hausdorff topological space?

In the following proof $D$ is a compact set in $\Bbb R$ and $B_{\frac {1}{n}}(x)$ is an open ball centered at $x$ with radius $1/n$.

$\forall x \in D^C$ the complements of closed balls $\{ \overline{B_{\frac{1}{n}}(x)}^X \}$ form an open cover of $D$ since we can verify that $\overline{B_{\frac{1}{n}}(x)}^C \nearrow \{x\}^C$. If $D$ is compact then this open cover has a finite subcover, say $\{ B_{N_1}(x) , B_{N_2}(x), \ldots , B_{N_k}(x) \}$ st. $D \subseteq \bigcup_k \overline{B_{\frac{1}{N_k}}(x)}^C$ where $N_1,N_2,\ldots,N_k$ are integers. Take $N = \max \{ N_1 , N_2, \ldots , N_k \}$, we have $D \subseteq \bigcup_k \overline{B_{\frac{1}{N_k}}(x)}^C = \overline{B_{\frac{1}{N}}(x)}^C$ $\Rightarrow$ $B_{\frac{1}{N}}(x) \subseteq \left( \overline{B_{\frac{1}{N}}(x)}^C \right)^C = \overline{B_{\frac{1}{N}}(x)} \subseteq D^C$. Thus we have shown that $\forall x \in D^C$ there exists an open ball $B_{\frac{1}{N}}(x) \subseteq D^C$, then $D^C$ is open and $D$ is closed. This proof is sketched in Figure [(b)].


 A: The proof makes use of the property that the Euclidean topology on $\mathbb R$ is metrizable: it is generated by a metric. Now, every metric space is Hausdorff—as a result, a non-Hausdorff topological space cannot admit a metric on it, so the proof strategy based on metrizability breaks down.

Here is a simple example. Let $X$ be any set containing at least two elements and let $\tau\equiv\{\varnothing, X\}$ be the indiscrete topology. This topology is the coarsest one there is: it contains only the empty set and the whole set. In fact, $\varnothing$ and $X$ are the only closed sets, too. Let $x\in X$ be arbitrary. Then, $\{x\}\neq X$ (since $X$ contains at least two elements) and $\{x\}$ is not empty. Therefore, the singleton set $\{x\}$ is not closed. But $\{x\}$ is compact, because it is a finite set: Any finite set is compact in any topological space.
The space $(X,\tau)$ in this counterexample is not Hausdorff. If $x_1$ and $x_2$ are two distinct members of $X$ (and such distinct members do exist, given the assumption that $\#X\geq 2$), then $X$ is the only open set containing either $x_1$ or $x_2$ (the only other open set in the space is $\varnothing$, which cannot contain any element). Consequently, there exists no pair of disjoint open sets such that one contains $x_1$ and the other $x_2$.
A: There's no balls in a general topological space. In fact, they're only in metric spaces which are always Hausdorff.
A: It should be pointed out that the proof does not need to rely on the properties of metric spaces.  Let $X$ be a Hausdorff space, and $A\subseteq X$ compact. We may disregard the case when $A=X$.  Let $x\in X\setminus A$.  For each $y\in A$ we can find a pair of disjoint open neighborhoods, $U_y,V_y$ of $x$ and $y$ respectively.
Now, the collection $\{B_y:y\in A\}$ is an open cover of $A$.  So there are finitely many $y_n\in A$ such that 
$$A=\bigcup_{k=1}^nV_{y_k}.$$
Let 
$$U=\bigcap_{k=1}^n U_{y_k}.$$
Note that $U$ is open because it is the intersection of finitely many open sets. Since, $U_{y_k}\cap V_{y_k}=\emptyset$ for each $k$, we have $U\cap A=\emptyset$.  So, $x$ is an interior point of $X\setminus A$. Therefore $X\setminus A$ is open and $A$ is closed.
As for an example of a space where there are compact subspaces which are not closed, consider $\Bbb R$ with the finite complement topology.  Here $U\subseteq X$ is open if and only $X\setminus U$ is finite or all of $X$.
In this situation, all subsets of $\Bbb R$ are compact:
Let $X\subset\Bbb R$, and $\mathscr A$ an open cover of $X$.  Let $A_0\in\mathscr A$.  If $X\cap(\Bbb R\setminus A_0)=\emptyset$, we are done.  So suppose $\Bbb R\setminus A_0=\{a_1,\ldots,a_n\}$, then for each $1\le k\le n$, there is an $A_k\in\mathscr A$ such that $x_k\in A_k$.  So, $X\subseteq\bigcup_{k=0}^n A_k$.
Now, take any infinite $A\subseteq X$. It is not closed because it is not finite.
A: Let $X$ be a set and put the topology $\{\emptyset, X\}$ on $X$.  Suppose $X$ contains at least the points $\{x_1, x_2\}$ as a proper subset.  This set of two points is compact (it is finite) but is is not closed.
