Understanding subspace topology In wiki article of "compact spaces", they state that the set $\mathbb{Q} ∩ [0,1]$ is not compact because the sets of rational numbers in the intervals $[0, \frac{1}{π} - \frac{1}{n}]$ and $[ \frac{1}{π}+ \frac{1}{n}, 1]$ covers all the rationals in $[0,1]$ but this cover does not have finite subcover; these sets are open in the subspace topology even though they are not open as subsets of $\mathbb{R}$. 
I don't get it! How is $[0, \frac{1}{π} - \frac{1}{n}]$ open in subspace topology for each $n∈ \mathbb{N}$  ? In particular, I need to know what are the open sets under subspace topology? What are the closed sets in subspace topology? What are the compact sets in subspace topology?

If $X$ is a topological space and $S$ is a subset of $X$ then the subspace topology is defined by taking


*

*the open sets of $S$ to be every set of the form $U \cap S$ where $U$ is an open set in $X$

*the closed sets of $S$ to be every set of the form $F \cap S$ where $F$ is a closed set in $X$
For the rational numbers, closed intervals defined by irrational endpoints are the same as open intervals: if $\alpha < \beta$ are irrational numbers then
$$ [\alpha, \beta] \cap \mathbb Q = (\alpha, \beta) \cap \mathbb Q.$$
This is because if $\alpha \le x \le \beta$ and $x$ is rational then $x \ne \alpha$ and $x \ne \beta$ (since $\alpha, \beta$ are irrational and $x$ is rational) so $\alpha < x < \beta$.
This means that the set $ [\alpha, \beta] \cap \mathbb Q = (\alpha, \beta) \cap \mathbb Q $ is both open and closed in the subspace topology of $\mathbb Q$. That is, it is both an open set intersected with $\mathbb Q$ and a closed set intersected with $\mathbb Q$.
For $S = [0,1] \cap \mathbb Q$ we have
$$\left[0, \frac1\pi - \frac1n \right] \cap S = \left[0, \frac1\pi - \frac1n \right) \cap S = \left(-1, \frac1\pi - \frac1n \right) \cap S. $$
Thus the set $\left[0, \frac1\pi - \frac1n \right] \cap S$ is both open and closed in the subspace topology.
