Compactness is not hereditary

Property-theoretic statement
The property of topological spaces of being a compact space is not a subspace-hereditary property of topological spaces.

Verbal statement
A subset of a compact space, equipped with the [[subspace topology], need not be a compact space.

Related facts

 * Compactness is weakly hereditary: Any closed subset of a compact space is compact.
 * Hausdorff implies KC: Any compact subset of a Hausdorff space is closed. In particular, in a compact Hausdorff space, the compact subsets are the same as the closed subsets.

Proof
Consider the unit interval $$[0,1]$$. This is a closed and bounded subset of the real line, hence it is compact. The subset $$(0,1)$$, equipped with the subspace topology, is not compact, because it has an open cover given by subsets of the form $$(1/(n+2),1/n)$$ that has no finite subcover. (Alternatively, it is not compact because it is not a closed subset of the real line).