Suppose $q$ is any nonzero rational number and $p$ is a fixed prime. If $q = p^k\frac{n}{m}$ for integers $n$ and $m$, neither of which has $p$ as a factor, then we define $|q|_p := p^{−k}$. We can then, of course, define a metric $d_p(q, q') := |q − q'|_p$.
Why is it that for any rational numbers $a < b$, the interval $[a, b]$ in $\mathbb{Q}$ is not compact with respect to this metric?
Compact of course means that every open cover of the space has a finite subcover.
The easiest way of seeing this is to remember that compactness is equivalent to sequential compactness in metric spaces.
Now, as $[a,b]$ is not a complete metric space, find a Cauchy sequence without a limit inside $[a,b]$ (say a sequence whose limit would be $a+\frac{\sqrt2(b-a)}2$). Now you have a sequence in the interval without a convergent subsequence, since a Cauchy sequence has a convergent subsequence if and only if it is convergent.
You can turn this idea into an open cover without a finite subcover by using intervals which are both closed and open (namely, they have irrational endpoints).