Proof function of r.v. is a r.v. My textbook says that $Y=g(X)$, where $X$ is a random variable and $Y=g(X)$, is not generally a random variable, since it need not satisfy the following condition,
$\{\omega\in\Omega:Y(\omega)=g(X(\omega))\leq x\}\in\mathcal F\quad \text{for all }x\in\mathbb R$,
where $\Omega$ is the sample space, and $\mathcal F$ the event space.
My textbooks proceeds to mention two types of functions for which it is always true that $Y=g(X)$ is a random variable, namely,
1) continuous functions,
2) monotone functions.
Right, so I would like to prove this for these two types of functions. This is how I started (for the continuous functions):
Let $y\in \operatorname{Im} Y$. We know $\exists \omega\in\Omega:Y(\omega)=y$. Now we want to show that $\{\omega\in\Omega:Y(\omega)\leq y\}\in\mathcal F$, for each $y\in\operatorname{Im}Y$.
But then I don't know how to proceed the proof... Could someone help me out?
 A: Since $X$ is a random variable, for every interval $I \subseteq \mathbb{R}$ we know that $\{X \in I\}$ is 
in the event space $\mathcal{F}$. The interval $I$ can be infinite in size and
can be open or closed at either end, such as $I = (-\infty, b)$,  $I=(-\infty, b]$, 
 $I = \mathbb{R}$, $I = (a,b)$, or $I = [a,b]$.   It follows that if $\{I_i\}_{i=1}^{\infty}$ is a countably infinite set of intervals, then $\cup_{i=1}^{\infty} \{X \in I_i\} \in \mathcal{F}$. So: 
-For nondecreasing or nonincreasing functions $g$:   You can draw a picture to convince yourself that 
the set $\{g(X)\leq y\}$ is the same as saying that $X$ lies in an interval, and hence describes an event in $\mathcal{F}$. 
-For continuous functions $g$:  It suffices to prove that sets of the form $\{g(X)>y\}$ are in the event space $\mathcal{F}$. Note that for any $y \in \mathbb{R}$, the set $\{x \in \mathbb{R} : g(x)> y\}$ is open.  You can use the fact that any open subset of $\mathbb{R}$ is a finite or countably infinite union of disjoint open intervals:  Any open subset of $\Bbb R$ is a at most countable union of disjoint open intervals. [Collecting Proofs]

Some related exercises for you to do: By the sigma-algebra definition of the event space $\mathcal{F}$ we know: (i) A finite or countable union of events in $\mathcal{F}$ is also in $\mathcal{F}$; (ii) The complement of an event in $\mathcal{F}$ is also in $\mathcal{F}$.   By the definition of random variable we also know $\{X \leq x\} \in \mathcal{F}$ for all $x \in \mathbb{R}$.   Show that: 
a) $\{X > x\} \in \mathcal{F}$ for all $x \in \mathbb{R}$. 
b) $\{X < x\} \in \mathcal{F}$ for all $x \in \mathbb{R}$. 
c) The intersection of two events in $\mathcal{F}$ is also in $\mathcal{F}$. 
d) $\{X \in (a,b)\} \in \mathcal{F}$ for all $x \in \mathbb{R}$. 
e) Complete the details to show that if $g$ is continuous then $g(X)$ is a random variable. 
