all topological spaces whose all subsets are compact I have this question on my recent homework problem set, and the only thing I came up with, is to eliminate some "options", like metric spaces or compact spaces. Is there any characteristic answer for that? Is the answer as obviuos as just "finite topological spaces" or there is something non-trivial?
 A: Such spaces are said to be hereditarily compact. In a Hausdorff space all compact subsets are closed, so every subset of a hereditarily compact Hausdorff space $X$ must be closed, and $X$ must therefore have the discrete topology. But a compact space with the discrete topology must be finite, so the hereditarily compact Hausdorff spaces are precisely the finite discrete spaces.
If we don’t require the space to be Hausdorff, however, there are many more hereditarily compact spaces. For instance, let $X$ be an infinite set with the cofinite topology. Of course all finite subsets of $X$ are compact, so suppose that $A$ is an infinite subset of $X$, and let $\mathscr{U}$ be an open cover of $A$. Let $U_0\in\mathscr{U}$. Then $A\setminus U_0\subseteq X\setminus U_0$, so $A\setminus U_0$ is finite, and it’s clear that some finite subset of $\mathscr{U}$ covers $A$. Thus, $X$ is hereditarily compact.
There are also non-$T_1$ spaces that are hereditarily compact. For instance, for each $n\in\Bbb N$ let $U_n=\{k\in\Bbb N:k\ge n\}$, and let $\tau=\{\varnothing\}\cup\{U_n:n\in\Bbb N\}$; then $\tau$ is a $T_0$ topology on $U_0$ that is not $T_1$, and you can easily check that $\langle U_0,\tau\rangle$ is hereditarily compact. Alternatively, you can notice that $\tau$ is a subset of the cofinite topology on $\Bbb N$ and prove the following result:

Proposition. Let $\tau_0$ and $\tau_1$ be topologies on $X$ such that $\tau_1\subseteq\tau_0$. If $\langle X,\tau_0\rangle$ is hereditarily compact, so is $\langle X,\tau_1\rangle$.

The space $\langle U_0,\tau\rangle$ is an example of a Noetherian space: a space $X$ is Noetherian if it satisfies the ascending chain condition for open sets, meaning that if $U_n$ is an open set in $X$ for each $n\in\Bbb N$, and
$$U_0\subseteq U_1\subseteq U_2\subseteq\ldots\,,$$
then there is an $n_0\in\Bbb N$ such that $U_n=U_{n_0}$ for all $n\ge n_0$. It’s easy show that every Noetherian space is hereditarily compact. These spaces arise naturally in algebraic geometry.
And if we don’t require any separation axioms at all, the indiscrete (or trivial) topology on any set is hereditarily compact, as is any other finite topology.
Added: As Ulli noted in the comments below, a space is hereditarily compact if and only if it is Noetherian.
In this answer Henno Brandsma proves that a space is Noetherian if and only if every open subset of it is compact. If every subset of $X$ is compact, then certainly every open subset of $X$ is compact, so $X$ is Noetherian.
For the other direction suppose that $X$ is Noetherian, and let $A\subseteq X$. Let $\mathscr{U}$ be a relatively open cover of $A$. For each $U\in\mathscr{U}$ there is an open $V_U$ in $X$ such that $U=V_U\cap A$; let $\mathscr{V}=\{V_U:U\in\mathscr{U}\}$. Then $\mathscr{V}$ is an open cover of the open set $\bigcup\mathscr{V}$. By the result that I quoted above, $\bigcup\mathscr{V}$ is compact, so there is a finite $\mathscr{U}_0\subseteq\mathscr{U}$ such that $\{V_U:U\in\mathscr{U}_0\}$ covers $\bigcup\mathscr{V}$. But then $\mathscr{U}_0$ covers $A$, so $A$ is compact, and $X$ is hereditarily compact.
