Compact sets need not be closed in a general topological space. For example, consider the set {a,b} with the topology {∅,{a},{a,b}} (this is known as the Sierpinski Two-Point Space). The set {a} is compact since it is finite.
Are compact sets closed and bounded?
Theorem A compact set K is bounded. Proof Pick any point p ∈ K and let Bn(p) = {x ∈ K : d(x, p) < n}, n = 1,2,.... ... The smallest (their intersection) is a neighborhood of p that contains no points of K. Theorem 2.35 Closed subsets of compact sets are compact.
Are compact sets closed in metric spaces?
Theorem Each compact set K in a metric space is closed and bounded.