how to prove $\mathcal B=\sigma(\mathcal S)?$ where $\mathcal S_{1}$ = {(a,b) :$-\inftylet $\mathcal B$ be the borel $\sigma-$algebra on $\mathbb  R$.
Define $\mathcal S_{1}$ 
= {(a,b) :$-\infty<a<b<\infty$} , $\mathcal S_{2}=${$[a,b] :-\infty<a<b<\infty $ } ,  $\mathcal S_{3}=${$[a,b) :-\infty<a<b<\infty  $}, $\mathcal U $ is the collection of all open sets in $\mathbb  R$, $\mathcal C$ is the collection of all closed sets in $\mathbb  R$ and $\mathcal K$ is the collection of all compact sets in $\mathbb  R$.
show that $\mathcal B=\sigma(\mathcal S)$, where $\mathcal S$ is any one of the collections $\mathcal S_{1},\mathcal S_{2},\mathcal S_{3},\mathcal U ,\mathcal C  $ or $\mathcal K$.
$\sigma(\mathcal S) $ is $\sigma$-algebra generataed by $\mathcal S$.
 A: $\sigma(\mathcal{U})=\mathcal{B}$ by definition. $\mathcal{S}_1$ is a basis for the usual topology of $\mathbb{R}$ (same for $\mathcal{C}$), so you should easily get that $\sigma(\mathcal{S_1})=\sigma(\mathcal{C})=\mathcal{B}$ (recall that the rationals are countable and dense in the real line).
Recall that the $\sigma$-algebra generated by a collection is the smallest $\sigma$-algebra that contains it. Consider the following intersection of intervals in $\mathcal{S}_3$: $\bigcap_{n \geq 1} [a+\frac{1}{n}, b)$. It is a countable union of intervals in $\mathcal{S}_3$, so it is there, and is actually equal to $(a,b) \in \mathcal{S}_1$. Can you see that this implies $\sigma(\mathcal{S}_3)=\sigma(\mathcal{S_1})$? 
For $\mathcal{K}$, recall that a  subset of $\mathcal{R}$ is compact $\iff$ it's closed and bounded (by Heine-Borel). So every compact set is closed and bounded. The complement of a closed set is an open set, all of which we know generate $\mathcal{B}$ (previous items). So $\sigma(\mathcal{K}) \subseteq \mathcal{B}$. Now take a closed set $C$. You may write it as the union $\bigcup_{n \geq 1} C\cap \overline{B(0,n)}$ ($B(0,n)$ is the open ball of radius $n$ around the origin). So $C$ is a countable union of compact sets. So $C \in \sigma(\mathcal{K})$. Thus $\sigma(\mathcal{K})$ has all closed (and open) sets and thus contains $\mathcal{B}$. Using both inclusions, $\sigma(\mathcal{K})=\mathcal{B}$.
