If all closed subsets of a set are compact, does it follow that this set is subset of a compact set?

Let $X$ be the space of countable ordinals with the order topology (a locally compact Hausdorff space, completely normal, but not metrizable), and let $Y$ be the set of all isolated points of $X$.

Every subset of $Y$ which is closed in $X$ is finite, since every infinite subset of $X$ has a limit point in $X$. (An infinite set of ordinals contains an increasing sequence; the limit of an increasing sequence of countable ordinals is a countable ordinal, i.e., an element of $X$.

$Y$ is not contained in any compact subset of $X$ because no uncountable subset of $X$ is compact or even Lindelöf.


P.S. Here is another example, a first countable, separable, locally compact Hausdorff space $X$ with a dense open subset $Y$ such that: $Y$ is countable and discrete; the only subsets of $Y$ which are closed in $X$ are the finite sets; and $Y$ is not contained in any countably compact subset of $X$.

Let $\mathcal A$ be an infinite maximal almost disjoint family of infinite subsets of $\omega$. $\mathcal A$ must be uncountable, as there is no maximal almost disjoint family of cardinality $\aleph_0$. Let $X$ be the corresponding $\Psi$-space, that is, $X=Y\cup\mathcal A$ where $Y=\omega$, and a set $U\subseteq X$ is open if $A\setminus U$ is finite for each $A\in U\cap\mathcal A$. All the properties claimed above are easily verified; the fact that every infinite subset of $Y=\omega$ has a limit point in $X\setminus Y=\mathcal A$ follows from the maximality of the almost disjoint family $\mathcal A$.

Unlike the previous example, this space $X$ is not normal; if $\mathcal A_0$ is a countably infinite subset of $\mathcal A$, then $\mathcal A_0$ and $\mathcal A\setminus\mathcal A_0$ are disjoint closed sets which can not be separated by open sets.


Here's a proof this can't happen in a metric space. Suppose $X$ is a metric space and that $A\subseteq X$ is a subset such that every $B\subseteq A$ which is closed in $X$ is compact.

Lemma. $A$ is totally bounded. proof. Assume it is not. Then there is $\varepsilon>0$ such that no finite collection of $\varepsilon$-balls cover $X$. Therefore we can define recursively a sequence of points $a_1,a_2,...$ each two of which are at distance at least $\varepsilon$ from one another. This is a subset of $A$ which is closed (if $x$ is in its closure then by taking an $\varepsilon/2$ neighbourhood of it we see we must have $x=a_n$ for some $n$) but clearly not compact (it's discrete and infinite).

Corollary. The closure of $A$ is totally bounded as well.

By assumption the closure of $A$ is not compact. Therefore, it's not complete, so it contains a Cauchy sequence which is not convergent. Therefore $A$ contains such a sequence as well. The set of points of this sequence is closed, but not compact. Contradiction.


If you don't mind abandoning all separation axioms, then it's really easy to find an example, because you can easily make there be very few closed subsets of your set. For instance, let $Y$ be any non-compact topological space, let $X=Y\times\{0,1\}$ where $\{0,1\}$ has the indiscrete topology, and let $A=Y\times\{0\}$. Then no nonempty subset of $A$ is closed in $X$, but $A$ is not contained in any compact subset of $X$.