Function of Discrete Random Variable

Theorem
Let $$X$$ be a discrete random variable on the probability space $$\left({\Omega, \Sigma, \Pr}\right)$$.

Let $$g: \R \to \R$$ be any real function.

Then $$Y = g \left({X}\right)$$, defined as:
 * $$\forall \omega \in \Omega: Y \left({\omega}\right) = g \left({X \left({\omega}\right)}\right)$$

is also a discrete random variable.

Proof
As $$\operatorname{Im} \left({X}\right)$$ is countable, then is $$\operatorname{Im} \left({g \left({X}\right)}\right)$$.

Now consider $$g^{-1} \left({Y}\right)$$.

We have that $$\forall x \in \R: X^{-1} \left({x}\right) \in \Sigma$$.

It follows that $$\forall x \in \R: g^{-1} \left({X^{-1} \left({x}\right)}\right) = \bigcup_{\omega \in g^{-1} \left({Y}\right)} \left\{{\omega \in \Omega: X \left({\omega}\right) = x}\right\}$$.

So $$g^{-1} \left({X^{-1} \left({x}\right)}\right)$$ is the union of elements of $$\Sigma$$.

As $$\Sigma$$ is by definition of probability space also a sigma-algebra, it follows that $$g^{-1} \left({X^{-1} \left({x}\right)}\right) \in \Sigma$$.