Let $a,b\in\mathbb{R}$ with $a<b$ we must prove that $$(a,b)=\bigcup_{n=1}^{+\infty} \bigg (a,b-\frac{1}{n}\bigg].$$ Obviously $$\bigcup_{n=1}^{+\infty}\bigg(a,b-\frac{1}{n}\bigg]\subseteq (a,b),$$ in fact, if $x\in\bigcup_n^{+\infty}\big(a,b-\frac{1}{n}\big]$ exists $n_0\in\mathbb{N}$ such that $x\in\big(a,b-\frac{1}{n_0}\big]\subseteq(a,b)$, then $x\in(a,b)$.
On the other hand $$\bigcup_{n=1}^{+\infty}\bigg(a,b-\frac{1}{n}\bigg]\supseteq (a,b),$$ about that let $x\in (a,b)$. From density of $\mathbb{Q}$ in $\mathbb{R}$ there are infinite values of $n\in\mathbb{N}$ such that $x\le q_n<b$, therefore $x\in (a,q_n]$ for infinite values of $n\in\mathbb{N}$.
At this point, how do we say that these $q_n$ are of the form $b-\frac{1}{n}$?
Thanks!
Suppose $x \in (a,b)$, then we have $b-x > 0$.
We can find $N \in \mathbb{N}, N>0$ such that $\frac1N < b-x $ and hence $x < b-\frac1N$.
Hence $x \in (a, b-\frac1N) \subset (a,b-\frac1N]$
Hence $x \in \bigcup_{n=1}^\infty (a,b-\frac1n]$.
Remark: To prove that something is in the union, we just have to show that it is inside one of the set in the union.