What if every nontrivial closed subset is compact? [duplicate]

This question already has an answer here:

I am struggling with this problem. I couldn't obtain anything from an arbitrary open covering of the space. I couldn't think of any counterexample. I tried googling it, but there were no results. The problem is:

Is a topological space $$X$$ compact if every nontrivial closed subset of $$X$$ is compact?

marked as duplicate by Jason DeVito, Moishe Kohan, MJD, Eric Wofsey general-topology StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jan 28 at 18:24

• Direct proof from covers: suppose we have an open cover of $X$. Let $O$ be a non-empty element of that cover. If $X=O$ we have a finite subcover. If not $X\setminus O$ is a proper closed subset of $X$ and the remaining elements of the open cover cover it, so by assumption these have a finite subcover. Add $O$ and we have a finite subcover of the original cover. Hence $X$ is compact. – Henno Brandsma Jan 28 at 20:01