Sigma-algebra generated by a random variable Let $X$ be a real random variable defined on $(\Omega,\mathcal{F},\mathbb{P})$. Why does $\sigma(X) = \{ X^{-1}(B) : B \in \mathcal{B}(\mathbb{R}) \}$ equal $\sigma(\{ X^{-1}(-\infty,x] : x \in \mathbb{R} \})$ ?
 A: As taking the inverse image is a cool operation. It commutes with practically everthing, here: with $\sigma(-)$. 

Lemma. Let $\Omega$, $R$ be any two sets, $X \colon \Omega \to R$ a map and $\mathcal A \subseteq \mathfrak P(R)$. Then 
  $$ \sigma\bigl(X^{-1}(\mathcal A)\bigr) = X^{-1}\bigl(\sigma(\mathcal A)\bigr) $$

Proof. To show $\subseteq$ note that the right hand side is a sigma algebra, as $\sigma(\def\A{\mathcal A}\A)$ is one and $X^{-1}(A^c) = X^{-1}(A)^c$ and $X^{-1}(\bigcup_n A_n) = \bigcup_n X^{-1}(A_n)$ hold for any $A, A_n \in \sigma(\mathcal A)$. As $X^{-1}(\A) \subseteq X^{-1}\bigl(\sigma(A)\bigr)$, we are done, since this implies now $\sigma\bigl(X^{-1}(\A)\bigr) \subseteq X^{-1}\bigl(\sigma(\A)\bigr)$.
To see $\supseteq$, let $\mathcal B := \bigl\{A \in \sigma(\A) : X^{-1}(A) \in \sigma\bigl(X^{-1}(\A)\bigr)\bigr\}$. As above, we see that $\mathcal B$ is a $\sigma$-algebra, and we have that $X^{-1}(A) \in \sigma \bigl(X^{-1}(\A)\bigr)$ for $A \in \A$. Hence $\A \subseteq \mathcal B$, therefore $\sigma(\A) \subseteq \mathcal B$ or - by definition of $\mathcal B$ - $X^{-1}\bigl(\sigma(\A)\bigr) \subseteq \sigma\bigl(X^{-1}(\A)\bigr)$. $\square$
Now, as $\{(-\infty, x] : x \in \mathbf R\}$ generates $\mathrm{Bor}(\mathbf R)$, by the lemma above $\{X^{-1}(-\infty, x]: x \in \mathbf R\}$ generates $\sigma(X)$.
