Why is $S = \{ x \in \mathbb{Q} | 2 < x^2 < 3 \}$ closed in $\mathbb{Q}$? I am focused on a specific part of the question Is the set $\{ x\in \mathbb{Q}: 2< x^2 <3\}$ closed, bounded, compact in $\mathbb{Q}$?. 
When the metric space is $\mathbb{Q}$ and the metric is $d(x,y) = |x-y|$ for $x,y \in \mathbb{Q}$, why is the set $S = \{ x \in \mathbb{Q} | 2 < x^2 < 3 \}$ closed in $\mathbb{Q}$? I know it is closed and bounded but not compact, but how can I prove the closed part?

You can prove that the complement of this set is open (the complement of open set is closed, and vise versa.) Specifically, the complement of $S$ is the union of three (disjoint) open sets namely $\{x>0 : x^2>3\}$, $\{x<0 : x^2>3\}$ and $\{x: x^2<2\}$. I only give the proof of openness of $\{x^2\in \Bbb{Q}:x^2<2\}$.
You may know that, $\Bbb{Q}$ is subspace of $\Bbb{R}$. So if $U$ is open in $\Bbb{R}$ then $U\cap\Bbb{Q}$ is open in $\Bbb{Q}$. Also, you can easily check that
$$\{x\in \Bbb{Q}:x^2<2\} : (-\sqrt{2},\sqrt{2})\cap\Bbb{Q}$$
and the proof is complete.
