A random variable X is a measurable function from (Ω, ℱ, P) to (ℝ, ℬ) where X⁻¹(B) ∈ ℱ for all Borel sets B. Measurability ensures that events like {ω: X(ω) ≤ x} are in ℱ and thus have well-defined probabilities. This definition unifies discrete and continuous random variables under one mathematical framework.
Verify measurability for familiar random variables (indicator functions, constant functions). Then examine why measurability is necessary for probability to be well-defined on events involving X.
You are working with a probability space (Ω, ℱ, P): a sample space Ω of outcomes, a sigma-algebra ℱ of events that have well-defined probabilities, and a measure P. A random variable X is a function from Ω to ℝ that is *measurable*: for every Borel set B ⊆ ℝ, the preimage X⁻¹(B) = {ω ∈ Ω : X(ω) ∈ B} must belong to ℱ. This single condition is what separates random variables from arbitrary functions.
The reason measurability is required is direct: ℱ is precisely the collection of subsets of Ω that have probabilities. If you want to talk about P(X ∈ B) — the probability that X takes a value in the set B — you need X⁻¹(B) to be an event in ℱ so that P(X⁻¹(B)) is defined. Without measurability, you could define a function X where {ω : X(ω) ≤ 3} is not in ℱ, making P(X ≤ 3) undefined. Measurability is the condition that guarantees every numerical statement about X ("X is between 1 and 2", "X exceeds 5", "X is rational") translates back into an event with a probability.
A concrete example grounds the abstraction. Let Ω = {H, T} (coin flip), ℱ = {∅, {H}, {T}, Ω} (all subsets), P(H) = P(T) = 1/2. Define X(H) = 1, X(T) = 0. To verify measurability, check preimages: X⁻¹({1}) = {H} ∈ ℱ, X⁻¹({0}) = {T} ∈ ℱ, X⁻¹(ℝ) = Ω ∈ ℱ, X⁻¹(∅) = ∅ ∈ ℱ. For any Borel set B, X⁻¹(B) is one of these four sets — all in ℱ. So X is measurable, and P(X = 1) = P({H}) = 1/2 is well-defined. This is the Bernoulli(1/2) random variable, expressed in full measure-theoretic formalism.
The power of this definition is unification. Discrete and continuous random variables are the same kind of mathematical object — a measurable function — differing only in the underlying probability space. For a continuous random variable, Ω might be ℝ itself with Lebesgue measure and a density function, and X might be the identity function. For a discrete variable, Ω might be a countable set with probability mass at isolated points. The measurability framework handles both identically, and it extends naturally to random vectors (functions into ℝⁿ), random functions, and random variables taking values in abstract spaces — always the same principle: preimages of measurable sets must be measurable.