Am I wrong in understanding random variables in this way I am learning stochastic process and is confused about the definition of random variable.
Here is what I understand .
We know that the three basic elements of a probability space is $(\Omega, \mathscr{F}, P)$, and the probability function is defined in $\mathscr{F}$, but the random variable is defined in $\Omega$.
And I understand in this way, for example.
Suppose that the $\Omega = \{1, 2, 3, 4, 5, 6\}$ and the $\mathscr{F}$ is $\{\{1, 2, 3\}, \{4, 5 ,6\}, 
\Omega, \varnothing\}$. I can define the probability as $P(\{1, 2, 3\}) = P(\{4, 5 ,6\}) = 0.5$, but I can not define the random variable in $\Omega$, because there is no element in $\Omega$ that satisfies $\{\omega : X(w) \leq x \} \in \mathscr{F}$.
 A: A random variable is a function $X: \Omega \to \mathbb{R}$ which is measurable with respect to the measures $\mathcal{F}$ and $\mathcal{B}_{\mathbb{R}}$. This is equivalent to $X$ verifying that for each $x\in \mathbb{R}$, it holds that $X((-\infty , x]) = \{\omega \in \Omega : X(\omega) \leq x\} \in \mathcal{F}$. Note that this definition does not involve your probability function $P$. If you find an $x \in \mathbb{R}$ such that no $\omega$ in $\Omega$ satisfies $X(\omega) \leq x$, then $\{\omega \in \Omega : X(\omega) \leq x\} = \varnothing$. But $\varnothing \in \mathcal{F}$, so finding such an $x$ does not prove that $X$ fails to be a random variable over $(\Omega, \mathcal{F})$.
For an example of a random variable on the sigma algebra that you defined, consider $X$ such that $X(\omega)= 7$ if $\omega \in \{1,2,3\}$ and $X(\omega)= 15$ if $\omega \in \{4,5,6\}$. Then we have that:
$$\{\omega \in \Omega : X(\omega) \leq x\}=\left\{ 
\begin{array}{c}
\varnothing \quad \text{ if }(x) < 7 \\ 
\{1,2,3\} \quad \text{ if } 7 \leq x < 15 \\
\Omega \quad \text{ if }  x \geq 15 \\
\end{array}
\right.$$
So the set $\{\omega \in \Omega : X(\omega) \leq x\}$ is measurable for each $x\in \mathbb{R}$ and thus $X$ is measurable.
