# Any open or closed subset of a locally compact space is also locally compact [duplicate]

I found this question in an exercise on a book:

Check that any open or closed subset of a locally compact space is also locally compact.

The definition of locally compact in the book is the following: a Hausdorff space is locally compact if for each point there is a compact neighborhood.

There is no other mention to this concept in the entire book, so I assume that a subset is locally compact if seeing it as a topological subspace then it is locally compact (Im not sure if this is the intended use of the concept for subsets).

But then is trivial that any subset of a locally compact space is also locally compact because any closed set and any open set of a subspace is induced by closed and open sets of the general space.

In other words: I cant see any reason that make me think that open or closed subspaces have a different behavior than any other subspace as locally compact spaces. It is my reasoning correct?

In other words: its possible that a subspace of a locally compact space would not be locally compact?

## marked as duplicate by HK Lee, Community♦May 18 '18 at 8:18

• – Math1000 May 18 '18 at 0:29
• The real line is locally compact. The subspace of rational numbers (which is neither open nor closed) is not locally compact. – Andreas Blass May 18 '18 at 0:43

If $K$ is compact then in general $K \cap Y$ will not be compact for a subspace $Y$ (and yes, the subspace topology is meant here), while neighbourhood-ness does inherit that way. You can find work-arounds for the closed and open subspace case though.
The rational numbers $\mathbb{Q}$ are not locally compact, even though the real line $\mathbb{R}$ is locally compact. While the proof of the statement is rather trivial, openness and closedness are used. Try writing out the proof more carefully to see where those properties come in to play.