Discussing compactness Consider $\mathbb{Q}$, the set of rational numbers, with the metric  $d(p,q)=|p-q|$. 

Then is 
$\{q\in \mathbb{Q}\; |\; -2\leq q^2\leq 4\}$ 
compact?

I guess $q^2$ is effectively lying between 0 and 4. Since it is bounded and closed. So compact. But the answer key says it is not. I wonder how.

I also wonder what the importance of the given metric is.
Is it really compact? Recall that a set in a metric space is compact iff it is complete and totally bounded.

Note that the sequence $q_n=\sum_{k=1}^n\frac{1}{k!}$ belongs to that set and it is a Cauchy sequence. 

What is its limit? Is it rational?
The set is not compact because it is not closed. The set has irrational limit points not contained in the set.