Assume $(\Bbb Q, d),$ $d(p, q):= |p -q|$ is a metric space and
$E := \{p \in \Bbb Q : 2 < p^2 < 3\} \subset \Bbb Q.$
I have to show that $E$ is closed.
I see two ways of proving this statement.
Approach 1:
First, we note that
$$E = \{p \in \Bbb Q : 2 < p^2 < 3\} = \{p \in \Bbb Q : \sqrt2 < p < \sqrt3\}.$$
Furthermore, $E$ is closed if and only if
$$\Bbb Q \setminus E := \{p \in \Bbb Q: p \notin (\sqrt2, \sqrt3)\}$$
is open. So, assume $p \in \Bbb Q \setminus E.$ I have to show that there exists an $\epsilon \gt 0$ such that
$B_{\epsilon}(p) \subset \Bbb Q \setminus E.$
We can assume that$ p \neq \sqrt2$ since $\sqrt2$ is irrational. Let $p$ be any other point that lies close to $\sqrt2$ while $p < \sqrt2$ still holds. Then, it follows directly that there must be an $\epsilon \gt 0$ such that
$|p - \sqrt2| \lt \epsilon.$
This works the exact same way for $\sqrt3,$ and other points of $\Bbb Q \setminus E$ don't require any attention. Therefore,
$B_{\epsilon}(p) \subset \Bbb Q \setminus E$
for every $p \in \Bbb Q \setminus E.$
Approach 2:
We remember the following theorem: (using the given premises of course)
$E$ is closed <=> $(x_k)$ is a sequence of points $x_k \in E$ that converges to a point $x \in \Bbb Q \Rightarrow x \in E$.
This obvously holds for every $x \in E$ since $E \subset \Bbb Q.$ Now, there can't be any other points of $\Bbb Q$ a sequence $(x_k)$ converges to since the infinum and suprenum are given by $\sqrt2$ and $\sqrt3$ (this doesn't make any sense, does it?), and neither can $(x_k)$ converge to $\sqrt2$ or $\sqrt3$ since they are irrational. So the statement would be trivially true.
Uhm, yeah, I'm really not sure about this one though. Can I really assume that the sequence doesn't converge to any other point bigger than $\sqrt3$ or smaller than $\sqrt2$? Furthermore, one could assume that a sequence (if it was a Cauchy-sequence) does indeed converge to $\sqrt2$ or $\sqrt3$ - at least this was the approach we took when proving that $\Bbb Q$ is not complete. On the other hand, following the theorem, I would have to assume that these irrational numbers are elements of $E$ then, which doesn't make any sense either.
Another approach:
Observe that the topology on $\mathbb Q$ is the same as the subspace topology on $\mathbb Q\subseteq\mathbb R$ as a subspace of $\mathbb R$ where $\mathbb R$ is equipped with its usual topology.
You can write: $$E=\mathbb Q\cap\left([-\sqrt3,-\sqrt2]\cup[\sqrt2,\sqrt3]\right)$$ Here $F:=[-\sqrt3,-\sqrt2]\cup[\sqrt2,\sqrt3]$ is closed in $\mathbb R$ and consequently $E=\mathbb Q\cap F$ is closed in subspace $\mathbb Q$.