Weak convergence of measures implying almost sure convergence of random variables Suppose $\mu,\mu_n$ are Borel probability measures on $\mathbb{R}$ with $\mu_n$ converging weakly to $\mu$. I am asked to find some probability space $(\Omega,\mathcal{F},\mathbb{P})$ and random variables $X,X_n$ such that $X$ has law $\mu$, $X_n$ has law $\mu_n$ and $X_n \to X$ almost surely as $n \to \infty$.
So far I tried to let $(\Omega,\mathcal{F},\mathbb{P}) = ((0,1),\mathcal{B}_{0,1},\text{Lebesgue})$ and defined $X_n$ as for $\omega \in (0,1)$ we let $X_n(\omega) = \inf\{x \in \mathbb{R}: \omega \in \mu_n((-\infty,x])\}$. Then $\mathbb{P}(X_n \in (-\infty,x]) = \mathbb{P}(X_n^{-1}((-\infty,x])) = \mu_n((-\infty,x])$ so $X_n$ has law $\mu_n$ and similarly for $X$.
However I am not able to prove that $X_n \to X$ almost surely. I have tried using contradiction, if $X_n \not\to X$ almost surely then we have that $|X_n-X| \geq 0$ and this does not converge to 0 almost surely. So the integral of this does not converge to $0$ as $n \to \infty$. However at this point I get stuck. I can't see where I should bring in the fact that $\mu_n \to \mu$ weakly.
How should I proceed?
 A: Let $\mu_n$, $\mu$ be probability measures on $\mathbb{R}$ such that $\mu_n$ converges weakly to $\mu$. The associated cumulative distribution functions $$F_n(x) := \mu_n((-\infty,x]) \qquad F(x) := \mu((-\infty,x])$$ then satisfy $$F_n(x) \to F(x) \tag{1}$$ for any continuity point $x$ of $F$.

Lemma Denote by $$\begin{align*} F_n^{-1}(t) &:= \inf\{x \in \mathbb{R}; F_n(x) \geq t\} \\ F^{-1}(t) &:= \inf\{x \in \mathbb{R}; F(x) \geq t\} \end{align*}$$ the generalized inverse functions of $F_n$ and $F$, respectively. If $t \in (0,1)$ is a continuity point of $F^{-1}$, then $$\lim_{n \to \infty} F_n^{-1}(t) = F^{-1}(t). \tag{2}$$

Once we have proved the result, we find immediately that the sequence of random variables defined in your question $$X_n(t) = F_n^{-1}(t) \qquad X(t) = F^{-1}(t)$$ satisifies $X_n(t) \to X(t)$ for any continuity point $t$ of $F^{-1}$; as $F^{-1}$ has at most countably many discontinuies, this shows $X_n \to X$ almost surely.
Proof of the lemma: Let $t \in (0,1)$ be a continuity point of $F^{-1}$. Since $F$ has at most countably many discontinuities, we can find for any $\epsilon>0$ a continuity point $x$ of $F$ such that $$F^{-1}(t)- \epsilon< x < F^{-1}(t).$$ As $$x < F^{-1}(t) \implies F(x) < t$$ and $\lim_n F_n(x) = F(x)$, we have $F_n(x)<t$ for large $n \in \mathbb{N}$, and the definition of the inverse yields $x \leq F_n^{-1}(t)$. Consequently, $$F^{-1}(t) - \epsilon < x \leq F_n^{-1}(t)$$ implying $$F^{-1}(t) \leq \liminf_{n \to \infty} F_n^{-1}(t).$$ It remains to show that $$\limsup_{n \to \infty} F_n^{-1}(t) \leq F^{-1}(t). \tag{3}$$ To this end, we note that for any $u>t$ and $\epsilon>0$ we can find a continuity point $y$ of $F$ such that $$F^{-1}(u) < y < F^{-1}(u)+\epsilon.$$ This implies $$F(y) \geq u > t.$$ As $y$ is a continuity point of $F$, this means that $F_n(y) \geq t$ for large $n \in \mathbb{N}$. Hence, $y \geq F_n^{-1}(t)$, and so $$F^{-1}(u)+\epsilon > y \geq F^{-1}_n(t)$$ for large $n$. Thus, $$\limsup_{n \to \infty} F_n^{-1}(t) \leq F^{-1}(u).$$ Letting $u \downarrow t$ we find from the (right)continuity of $F^{-1}$ at $t$ that $(3)$ holds.
Reference: Theorem 8.3.2 in S.I. Resnick: A probability path, Birkhäuser 2013.
