A statement true about compacts but false about closed sets Suppose that you have a metric space $X$. Could you give an example of a theorem or a statement that holds for compact sets but does not hold for closed sets?

This question is motivated from a paragraph in Stephen Abbott's Understanding Analysis:

Whenever a fact involving closed intervals (in $\mathbb{R}$)  is true, it is often the case that the same result holds when we replace "closed interval" with "compact set."

What would be the fact that contradicts the inverse statement?
 A: Every open covering of a compact set has finite subcovering.
A: “The continuous image of a (blah) set is (blah).” True when (blah) is “compact”, false when (blah) is “closed”. 
A: In a metric space, every sequence in a compact set has a subsequence that converges. This need not be true if the set is simply closed. As a counterexample think of $a_n=n$: the sequence is in the set $\mathbb R$ which is closed (but not compact) and
$$
\lim_{n\to+\infty}a_n=+\infty \notin \mathbb R
$$
A: Note that in Euclidean spaces, such as $\mathbb{R}$, a set is compact if and only if it is closed and bounded. So what you're looking for is something that separate bound and unbound sets. The most trivial one is: "every compact set in $\mathbb{R}$ is bound", which is true, but not true for closed sets, since for instance $\mathbb{R}$ itself is a closed set.
A: You may not have encountered all of these definitions yet, but here is a hint at the bigger picture.
The Heine–Borel theorem states that the following are equivalent for a subspace $E \subset \mathbb{R}^n$:

(1) $E$ is compact.
(2) Every subsequence in $E$ has a convergent subsequence.
(3) $E$ is closed and bounded.

This theorem can be generalized to any metric space $X$ with a slight modification:

(1) $X$ is compact.
(2) Every subsequence in $X$ has a convergent subsequence.
(3) $X$ is totally bounded and complete.

In case these definitions are new:
A metric space $X$ is called totally bounded if for each $ \varepsilon > 0$, there exists a finite number of open balls of radius $\varepsilon$ that cover $X$.
A metric space $X$ is called bounded if there exists $b > 0$ such that $d(x,y)<b$ for all $x,y\in X$.
As Andreas pointed out above, we can break stuff if we remove the 'bounded' condition. A similar example is the theorem that any continuous function on a metric space will achieve its maximum and minimum on a compact set, e.g., any continuous function on a (finite and closed) interval $[a,b]\subset\mathbb{R}$. However, $\mathbb{R}\subset\mathbb{R}$ is itself closed, but a function like $f(x) = x$ has no maximum or minimum on $\mathbb{R}$ because $\mathbb{R}$ is not bounded.
