What does it mean for two random variables to be independent? What are the events associated with a random variable?1
The set of inverse images of the measurable sets under any function form a sigma algebra. If the function is measurable, then this sigma algbera is a sub-$\sigma $-algebra of the domain sigma algebra.
\[ \mathcal{C} = \Set*{f^{-1}(B)}{B \in \mathcal{B} } \]
is a $\sigma $-algebra. $f$ is measurable if and only if $\mathcal{C} \subset \mathcal{A} $.\[ X - C \in \mathcal{C} \quad \text{for all } C \in \mathcal{C} \]
To see this let $C \in \mathcal{C} $. By definition, there exists a set $B \in \mathcal{B} $ of which $C$ is the inverse image. In symbols, $C = f^{-1}(B)$. Then $X - C = X - f^{-1}(B) = f^{-1}(Y - B)$. Since $\mathcal{B} $ is a sigma algebra, $B \in \mathcal{B} , Y - B \in \mathcal{B} $ and so $X - C \in \mathcal{C} $.\[ \cup_{n = 1}^{\infty} C_n \in \mathcal{C} \quad \text{for all } \seq{C} \]
To see this, suppose $\seq{C}$ is a sequence of sets in $\mathcal{C} $. Then for every $n$ there exists a $B_n \in \mathcal{B} $ so that $C_n = f^{-1}(B_n)$. Then:\[ \cup_{n} C_n = \cup_n f^{-1}(B_n) = f^{-1}(\cup B_n). \]
Since $\mathcal{B} $ is a sigma algebra, $\cup_n B_n \in \mathcal{B} $ and so $\cup_{n} C_n \in \mathcal{C} $.Next we show that $f$ is measurable if and only if $C \subset \mathcal{A} $. The if direction is by definition. For the only if direction, suppose $f$ is measurable. Then for any $B \in \mathcal{B} $, we have that $f^{-1}(B) \in \mathcal{A} $. Hence $\mathcal{C} \subset \mathcal{A} $ by definition.
The sigma algebra generated by a random variable is the sigma algebra consisting of the inverse images of every measurable set of the codomain.
The sigma algebra generated by a family of random variables is the sigma algebra generated by the union of the sigma algebras generated individually by each of the random variables.
Let $(X, \mathcal{A} , \mu )$ be a probability space and $(Y, \mathcal{B} )$ be a measurable space. Let $f: X \to Y$ be a random variable. Denote by $\sigma (f)$ the sigma algebra generated by $f$.