Q:

Existence of a random variable

Let $\mu$ be a probability measure on $(\mathbb{R},\mathcal{B}(\mathbb{R}))$, where $\mathcal{B}(\mathbb{R})$ denotes the Borel sets.
Then, is it true that there exists a probability space $(\Omega,\Sigma,\mathbb{P})$ and a random variable $X$ defined on this probability space such that
$$ P(X \in B) = \mu(B)$$ for every borel set $B$?
I know the "converse" of the claim is true: given a random variable $X$ on some probability space, there exists a probability measure on $\mathbb{R}$ such that $ P(X \in B) = \mu(B)$.

A:

You can always take the probability space to be the interval $(0,1)$ with the Borel sigma-algebra and the Lebesgue measure on it. Define the random variable $X$ to be $X(\omega)=G(\omega)$ for $\omega\in(0,1)$, where $G$ is the quasi-inverse of the cumulative distribution function $F$ of $\mu$, meaning
\begin{equation}
F(x)=\mu((-\infty,x]) \quad \textrm{and} \quad G(\omega)=\sup F^{-1} ([0,\omega])=\sup\{s\in\mathbb{R}\ |\ F(s)\leq \omega \}.
\end{equation}
Here $F^{-1}$ denotes the preimage under the function $F$. This is a very nice and very important lemma, you should prove it for yourself.

