TITLE: What do compact sets look like in the rationals?
QUESTION [24 upvotes]: I'm trying to prove that $\mathbb Q$ is not locally compact and I'm having trouble seeing what the compact sets are.
Besides merely thinking of sets and then checking if they are compact or not, is there a better way of finding the compact sets?
EDIT: Any subset of the rationals $[q_1,q_2]\cap \mathbb Q$ is not compact because we can take a cover which covers both endpoints but limits from both sides to an irrational inside the interval.
EDIT2: The only compact subsets that I can find are finite subsets.

REPLY [7 votes]: The only compact sets in $\mathbb Q$ are nowhere dense. This is example 31 in Counterexamples in topology by Seebach.
A set $A$ in space $X$ is called nowhere dense if $X\setminus \mathrm{cl}(A)$ is dense