I have proved the following statement and I would like to know if my proof is correct, thank you.
"$\mathcal{S}$, smallest $\sigma$-algebra on $\mathbb{R}$ containing $\{(r,r+1):r\in\mathbb{Q}\}$, is the set of Borel subsets of $\mathbb{R}$".
DEF. (Borel set): The smallest $\sigma$-algebra on $\mathbb{R}$ containing all open subsets of $\mathbb{R}$, $\mathcal{B}$, is called the collection of Borel subsets of $\mathbb{R}$. An element of this $\sigma$-algebra is called a Borel set.
LEMMA (1): Let $x\in\mathbb{R}$: then there exists both a decreasing sequence and an increasing sequence of rational numbers converging to $x$.
LEMMA (2): Every open subset of $\mathbb{R}$ can be written as a countable union of disjoint open intervals.
Let $(a, b), a,b\in\mathbb{R}, a<b$ be an open subset of $\mathbb{R}$. Then by LEMMA (1) there exist a decresing sequence of rational numbers $(a_i)$ such that $a_i\overset{i\to +\infty}{\to} a$ and an increasing sequence of rational numbers $(b_i)$ such that $b_i\overset{i\to +\infty}{\to}b-1$.
Now, since $\mathcal{S}$ is a $\sigma$-algebra we have that:
$[1]\ \mathbb{R}\setminus (a_i,a_i+1)=(-\infty,a_i]\cup [a_i+1,+\infty)\in\mathcal{S}$;
$[2]\ \mathbb{R}\setminus (b_i,b_i+1)=(-\infty,b_i]\cup [b_i+1,+\infty)\in\mathcal{S}$;
$[3]\ \bigcup_{i=1}^{\infty}\mathbb{R}\setminus (a_i,a_i+1)=(-\infty,a]\cup [a+1,+\infty)\in\mathcal{S}$;
$[4]\ \bigcup_{i=1}^{\infty}\mathbb{R}\setminus (b_i,b_i+1)=(-\infty,b-1]\cup [b,+\infty)\in\mathcal{S}$;
$[5]\ (-\infty, b-1]=\bigcup_{k=1}^{\infty} (-k,b-1]\in\mathcal{S}$;
$[6]\ [a+1,+\infty)=\bigcup_{k=1}^{\infty} [a+1, k)\in\mathcal{S}$.
From $[4]$, $[5]$, using the fact that $\sigma$-algebras are closed under differences of sets we get $(-\infty,b-1]\cup [b,+\infty)\setminus (-\infty,b-1]=[b,+\infty)\in\mathcal{S}$ and similarly from $[3]$ and $[6]$ that $(-\infty,a]\cup [a+1,+\infty)\setminus [a+1,+\infty)=(-\infty, a]\in\mathcal{S}$ so it is also $(-\infty,a]\cup [b,+\infty)\in\mathcal{S}$ hence $(a,b)\in\mathcal{S}$.
By LEMMA (2) and the fact that $\sigma$-algebra are closed under unions we have thus proved that the $\sigma$-algebra $\mathcal{S}$ contains every open subset of $\mathbb{R}$ but since by definition $\mathcal{B}$ is the smallest such $\sigma$-algebra it must be $\mathcal{B}\subset\mathcal{S}$. Similarly, since $(r,r+1)\in\mathcal{B}$ for every $r\in\mathbb{Q}$ (they are open sets in $\mathbb{R}$) and by definition $\mathcal{S}$ is the smallest $\sigma$-algebra containing these intervals, it must also be $\mathcal{S}\subset\mathcal{B}$ thus we can conclude that $\mathcal{S}=\mathcal{B}$, as desired.
EDIT: This question is not a duplicate of Show that $\mathcal{J}=\{[a, a+1) \mid a \in \mathbb{R}\}$ generates the Borel set of $\mathbb{R}$
Here the intervals are open intervals with rational end-points, not semi-open intervals with real end-points. This difference leads to different answers. The two questions are related but not duplicate.
First: This question is not a duplicate of Show that $\mathcal{J}=\{[a, a+1) \mid a \in \mathbb{R}\}$ generates the Borel set of $\mathbb{R}$
In this question, the intervals are open intervals with rational end-points, not semi-open intervals with real end-points. This difference leads to different answers. The two questions are related but not duplicate.
Second : Here is a simpler solution.
Let $\mathcal{S}$ be the smallest $\sigma$-algebra on $\mathbb{R}$ containing $\{(r,r+1):r\in\mathbb{Q}\}$. Then,
Step 1. Given any $a, b\in \Bbb Q$ such that $a \leq b \leq a+1$, take $c= b-1$. Then $c \in \Bbb Q$ and
$$(a,b) = (c, c+1) \cap (a, a+1) \in \mathcal{S}$$ So $\mathcal{S}$ has all open intervals with rational endpoints and length less or equal $1$.
Step 2. Given any $a, b\in \Bbb Q$ such that $a \leq b$, we can easily write $(a,b)$ as a finite union of (overlapping) open intervals with rational endpoints and length less or equal $1$. In fact, let $n \in \Bbb N$ be such that $a + n/2 \leq b \leq a +(n+1)/2$, then
$$ (a,b) = \left (a+\frac{n-1}{2},b \right) \cup\bigcup_{k=0}^{n-2} \left (a+\frac{k}{2},a+\frac{k+2}{2} \right ) $$ It is easy to check that all intervals on the right side are open intervals with rational endpoints and length less or equal $1$. So all open intervals with rational endpoints are in $\mathcal{S}$ .
Step 3. Given any $a,b \in [-\infty, \infty]$, we can find a sequence $\{a_n\}$ of rationals in $(a,b)$ such that $a_n \to a$ and a sequence $\{b_n\}$ of rationals in $(a, b)$ such that $b_n \to b$. It is immediate that $$(a,b) = \bigcup_{n=1}^\infty (a_n,b_n)$$ So $(a,b) \in \mathcal{S}$. Thus, all open intervals are in $\mathcal{S}$.
Step 4. By lemma 2, all open sets are in $\mathcal{S}$ and so $\mathcal{B} \subset \mathcal{S}$. Since, for all $r \in \Bbb Q$, $(r,r+1) \in \mathcal{B}$, we have that $\mathcal{S} \subseteq \mathcal{B}$. So, $\mathcal{S} = \mathcal{B}$.