$[0,1]\cap\mathbb{Q}$ is not compact in $\mathbb{Q}$

I know this question has already been answered in some posts on MSE but I am posting it to clear my doubt.

I have another reasoning for this question could someone please tell me whether I am correct;Let $X,Y$ and $Z$ be topological spaces such that $X$ is subspace of $Y$ and $Y$ is subspace of $Z$.We know that if $Y$ is subspace of $Z$ and $X$ is subspace of $Y$ then $X$ is Subspace of $Z$.Now for $X$ to be compact in $Y$,it has to be compact under subspace topology induced by $Y$ but then $X$ is also subspace of Z and hence it has to be compact under subspace topology induced by $Z$.So for $[0,1]\cap\mathbb{Q}$ to be compact in $\mathbb{Q}$ it is equivalent to say that it is compact subset of $\mathbb{R}$(since $[0,1]\cap\mathbb{Q}$ with subspace topology of $\mathbb{Q}$ is same as subspace topology induced by $\mathbb{R}$) and hence we can used Heine Borel theorem now.Therefore $[0,1]\cap\mathbb{Q}$ is not compact in $\mathbb{Q}$.


Just to confirm: yes, compactness is "absolute" in that indeed if $K:=[0,1]\cap \Bbb Q$ were compact in $\Bbb Q$ it would also be compact in $\Bbb R$. And $K$ is not closed in $\Bbb R$ (its closure is $[0,1]\neq K$) so cannot be compact in $\Bbb R$ (compact implies closed in the space for any metric space; note that $K$ is closed in $\Bbb Q$ so we need to look in the reals for this to work).

But there are plenty of other "reasons" too, as you found in the other answers.