Borel sigma-algebra construction Consider the Borel sigma-algebra on $\mathbb{R}$, $\mathcal{B}(\mathbb{R})$. The definition I've been working is that $\mathcal{B}(\mathbb{R})$ is the smallest sigma-algebra containing all open sets of $\mathbb{R}$. However, I just read that $\mathcal{B}(\mathbb{R})$ can be constructed by choosing to contain all sets of the form $[a,b]$, $(a, b]$, $(a,b)$, and $[a,b)$ for all real numbers $a$ and $b$. What I don't understand is, why is $[a,b] \in \mathcal{B}(\mathbb{R})$? Is it because $(-\infty, a) \cup (b, \infty) \in \mathcal{B}(\mathbb{R})$ so the complement $[a,b] \in \mathcal{B}(\mathbb{R})$? Then, how can I show that $(a, b] \in \mathcal{B}(\mathbb{R})$? 
 A: A $\sigma$-algebra is a Boolean algebra. A Boolean algebra contains the complements of its members. $ B(R)$ contains all open sets so it contains their complements, which is all closed sets. Like $[a,b].$ It will also contain the intersection of any closed set with any open set, like $(a,b]=(-\infty,b]\cap (a,\infty).$
$B(R)$ can be generated by just the bounded open intervals because any open set in $R$ is the union of countably many bounded open intervals.  
A: Say $B$ is the "standard" Borel $\sigma$ algebra on $\mathbb{R}$, the smallest $\sigma$ algebra containing all the open sets on $\mathbb{R}$. And let $B'$ be the smallest $\sigma$ algebra containing all the bounded intervals, i.e., all of the intervals $[a,b]$, $[a,b)$, $(a,b]$, and $(a,b)$ for all $a,b \in \mathbb{R}$. The claim is that $B = B'$.
Certainly $B$ contains every bounded open interval $(a,b)$. You have stated a reason why $[a,b] \in B$: $B$ contains the open set $(-\infty,a) \cup (b,\infty)$ whose complement is $[a,b]$. Alternatively, write $[a,b]$ as a countable intersection of open sets:
$$
  [a,b] = \bigcap_{n=1}^{\infty} \left(a-\frac{1}{n},b+\frac{1}{n}\right).
$$
As observed in the comments, the other types of intervals can be obtained via intersections (or unions!) with open sets, which are in $B$: $(a,b] = [a,b] \cap (a,b+1)$, or $(a,b] = (a,b) \cup [(a+b)/2,b]$; or for that matter
$$
  (a,b] = \bigcap_{n=1}^{\infty} \left(a,b+\frac{1}{n}\right).
$$
Similar things work for $[a,b)$. This proves that $[a,b], (a,b], [a,b) \in B$; so $B' \subseteq B$.
For the reverse inclusion, use the fact that every open set in $\mathbb{R}$ is a countable (or finite) union of bounded intervals. First, every open set is a countable union of open intervals (if you haven't seen this, hint: rational numbers), and if any of the open intervals are unbounded, they can be written as countable unions of bounded intervals. This shows $B'$ includes every open set, so $B \subseteq B'$.
A: There is a more general stronger result that is no harder to prove. Suppose $\tau$ is a topology on a space $X.$ Then by definition,  $\mathscr B(X)=\sigma(\tau).$ 
Claim: if $X$ is a second countable topological space, then $\mathscr B(X)$  is generated by any countable base for $X.$ 
To see this, let $\mathscr E$ be a countable base for the topology $\tau.$ Since $\mathscr E \subseteq  \tau,\ \sigma (\mathscr E) \subseteq \sigma (\tau)=\mathscr B(X).$ For the reverse inclusion, we simply note that if $U\in \tau$ then $U$ is a countable union of elements of $\mathscr E$ so $U\in \sigma (\mathscr E),$ which means that $\sigma (\tau)\subseteq \sigma (\mathscr E).$
So in the case $X=\mathbb R$ we have that $\mathscr B(\mathbb R)$ is generated by the collection of open intervals with rational endpoints. Furthermore, since the closed and half-closed intervals are countable unions of open intervals, $\mathscr B(\mathbb R)$ is also generated by the collection of closed and half-closed intervals. 
