Consider $A=\{q \in \mathbb Q:q^2 \geq2\}$ and the metric $d(x,y)=|x-y|$.
Then considered as a subset of the metric space $(\mathbb R,d) A$ is not open since none of the points of $A$ is an interior point of A since every nbd in $\mathbb R$ contains irrational numbers not belonging to $A$. Also $\sqrt2 $ is a limit point of $A$ not contained in $A$ so $A$ is not closed either.
However, when considered as a subset of the metric space $(\mathbb Q,d)$ it is both open and closed. Since now the nbds only contain rationals, we can find one of every point that lies inside $A$. And now since the parent space is $\mathbb Q$, $\sqrt 2$ is no longer considered a limit point and the remaining limit points are all the members of $A$ thus lying inside $A$ and making it closed.
Is this reasoning correct? Am I right in assuming that a subset is open or closed depending on the set it is considered a subset of?
Yes, it matters quite a lot which is the parent space when you consider questions of openness or closedness of sets.
In general, if $A \subseteq Y \subseteq X$ then $A$ is closed in $Y$ (where $Y$ has the subspace topology inherited from $X$) iff $A = C \cap Y$, where $C$ is closed in $X$, so closed sets in the subspace are just intersections of closed sets in the larger space with that subspace. The same holds for open sets. In terms of the metric, this nicely corresponds with restricting the metric on $X$ to points of $Y$, as you do here.
$A$ is closed (open) in $\Bbb Q$ because there it is just a closed (open) set of $\Bbb R$ intersected with $\Bbb Q$:, $$A= \left((-\infty,-\sqrt{2}] \cup [\sqrt{2}, +\infty)\right) \cap \mathbb{Q} = \left((-\infty,-\sqrt{2}) \cup (\sqrt{2}, +\infty)\right) \cap \mathbb{Q}$$
nicely abusing the fact that $\pm \sqrt{2}$ are not in $\Bbb Q$.