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?
 A: 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.
A: At a more abstract level, which is hinted at in the question you link to is the fact that:
$$((\sqrt{2},\sqrt{3})\cup(-\sqrt{3},-\sqrt{2})) \cap \mathbb Q =([\sqrt{2},\sqrt{3}]\cup[-\sqrt{3},-\sqrt{2}])\cap \mathbb Q$$
tells us that since the set equals a closed interval intersected with $\mathbb Q$, it inherits its closedness from the topology on $\mathbb R$ (as $\mathbb Q$ has the subset topology induced by $\mathbb R$).
However, we can certainly do this without appealing to embedding $\mathbb Q$ in a larger space. To prove it, we just need that $\{x\in \mathbb Q :x^2\leq 2\}\cup \{x\in\mathbb Q : x^2\geq 3\}$ is open. Both the components of that union happen to be open, so I'll just prove one, and the other has an analogous proof. In particular, starting from the fact that there is no rational such that $x^2=2$, it follows that if $x^2\leq 2$, then $x^2<2$. Then, notice that, for $d<|x|$ we have $$(|x|+d)^2=|x|^2+2|x|d+d^2<x^2+3|x|d$$
hence if we set $d=\min(|x|,\left|\frac{2-x^2}{3x}\right|)$ it is clear that for all (rational) $y$ in the ball of radius $d$ around $x$ are in the set $\{x\in \mathbb Q : x^2\leq 2\}$. Thus that set is open. Then, you prove the other set is open, and conclude that the complement of the given set is open, hence the given set is closed. (This is a lot harder than just treating $\mathbb Q$ as a subset of $\mathbb R$)
