# Finding a random variable for a given distribution function and probability measure

Let $$F:\mathbb{R} \rightarrow \mathbb{R}$$ be a distribution function, i.e., it is monotonically increasing and $$F(-\infty)=0,F(+\infty)=1$$ and let $$P$$ be a probability measure on some space $$\Omega$$. Then is there some random variable $$X$$ on $$\Omega$$ such that $$F$$ is the distribution function associated with $$X$$, i.e., $$F(\lambda) = P(X \le \lambda)$$.

Remarks. I know that if $$P$$ is the Lebesgue measure on $$(0,1)$$, then we could just define $$X(\omega) = \sup \{\lambda\in \mathbb{R}):F(\lambda) < \omega\}$$, but does it also hold for general spaces $$\Omega$$?

Certainly not. If $$\Omega$$ has single point then any random variable on it is a constant. You need at least a nice space $$\Omega$$ and a non-atomic probability measure $$P$$ to be able to find such random variables.