TITLE: A compact set, which is not closed.
QUESTION [7 upvotes]: I'm looking for a compact set, which is not closed.
I read somewhere that $Z^+$ are compact and not closed, but I don't understand why. 
Are there any other examples of compact sets that are not closed and could you please explain? 
I know that we can't look in the reals because every compact set in the reals is closed and bounded correct?

REPLY [4 votes]: Let $X$ be an infinite set, and equip it with the cofinite topology (i.e., $F \subset X$ is closed iff $F=X$ or $F$ is finite). Then every subset of $X$ is compact: if $(U_{\alpha})_{\alpha \in I}$ is any open covering of $E$, then for any fixed $\bar{\alpha} \in I$ the set $U_{\bar{\alpha}}$ contains all but finitely many points of $E$, so fix $U_{\alpha_1}, \dots, U_{\alpha_n}$ that cover these remaining points.
I like this example because $X$ is a $T_1$ space, so in a sense it is "almost" Hausdorff.