I'm trying to prove (or confute) that the set $$\mathbb{Q}\cap [0, 1]$$ is compact.
So here is my work so far.
First of all, compact = closed and bounded.
About the closure, I thought of this: I can write the set as
$$\mathbb{Q} \cap [0, 1] = \bigcup_{i, j} \{\frac{a_i}{b_j}\} \qquad a_i, b_j \in\mathbb{Z} \quad 0 \leq \frac{a_i}{b_j} \leq 1$$
Which means a countable-infinite union of singletons.
Now, since they are singletons, they are closed sets. Indeed we know that $A$ is open if $\forall \epsilon > 0$, $\exists x \in A$ such that $B_{\epsilon}(x) \subset A$.
In singletons this condition is violated, hence they are not open.
Also the complementary of this union of singletons is a union of open sets, which is open. Hence this union of singleton is closed.
I don't know if is there a better (or right, if this is wrong) way to prove the closure...
About the bounded part, I thought that this comes from the fact that $\mathbb{Q}$ intersects a bounded set, that is $[0, 1]$. If the set were $(0, 1)$ then it wouldn't have been bounded, hence not compact.
Please tell me if I'm wrong, of if there is some more elegant way to proceed.
Reference Request
Is there some good book, or online notes, where I can find similar exercises, possibly with solutions?
It is not compact. Take $a_n = \sum_{k = 2}^n \frac{1}{k!}$, which is always a rational number bewteen $0$ and $1$, but it converges toward $e - 2$, which is irrational. $\mathbb{Q} \cap [0,1]$ is not closed in $\mathbb{R}$. It is even dense in $[0,1]$.