What is the right way to define a random variable? This question is a little bit about using the right semantics. In most literature I encounter a definition of a random variable $X$ over a measurable space $(\Omega, F)$ as a measurable function $X: \Omega \rightarrow R$ with respect to $F$, thus implying that $\{\omega: X(\omega)\in B\} \in F, \forall B\in B(R)$, where $B(R)$ is the Borel sigma algebra on $R$ (note $\forall B\in B(R)$). In fewer textbooks a random variable is defined as a real-valued measurable function. The second definition feels more "right" to me, because for example in the case of an indicator random variable $I_{A}$ the range is just $\{0, 1\}$, so how am I supposed to interpret $I_{A}^{-1}([4, 5])$? I can refer to this as the set of all $\omega$-s, for which $I_{A}(\omega) \in [4,5]$, resulting in $\emptyset$, but is it even legal? In Kolmogorov's book a mapping's range is defined as the set of all values the function takes, so I don't know how to feel about taking the reverse of a set which is out of function's range. Whenever I see  $X: \Omega \rightarrow R$ I read it as "domain of $X$ is $\Omega$, values of X are the whole real plane", whereas saying "real-valued" sort of means "values of $X$ reside in some subset of $R$". Any thoughts about this?
 A: Some misconceptions seem to take place, I am afraid. i) In modern notation, the string $X \to Y$ of symbols means a function whose domain is $X$ and whose codomain is $Y$. The range of a function is the "smallest" codomain, i.e. the set of all values of the function. ii) The preimage map $f^{-1}$ is a function from $2^{Y}$ to $2^{X}$. So it can eat any subset of the codomain $Y$, whether the given subset is included in the range or not. So it is legitimate to write $I^{-1}(\{ 2 \}) = \varnothing$, for example, where $I$ is the indicator function of the set $\{ 2 \}$, which is not a subset of the range $\{ 0, 1 \}$ of $I$. iii) If by $R$ you denoted the set of all real numbers, then writing $f: \Omega \to R$ is the same as saying $f$ is a real-valued function defined on $\Omega$. The function $f$ taking values in real numbers does not presume that the values of $f$ must exhaust the reals. The function $[0,1] \to [0,1]$ by $x \mapsto x/2$ is also real-valued; but it does not take on every real number as its value. iv) The empty set $\varnothing$ is measurable in any sigma-algebra by definition (if $\mathscr{F}$ is a sigma-algebra over $\Omega$, and if $E \in \mathscr{F}$, then $E \cap E^{c} = \varnothing \in \mathscr{F}$), so there is nothing to worry here.
