If $X_n$ converges to $X$ in probability, then for $f$ continuous, then $f(X_n)$ converges in probability to $f(X)$ The following is an exercise in the book Measure Theory and Probability, by Athreya and Lahire.
Let $X_n$ converge to $X$ in probability. If $f$ is continuous, then $f(X_n)$ converges in probability to $f(X)$
This seems like a simple exercise, but I haven’t been able to solve it. This is what I have tried so for.
Assuming that $f$ is uniformly continuous, then for
$$\epsilon > 0 \ \exists \delta >0 : \mid X_n(w) - X(w) \mid < \delta \implies \mid f(X_n(w)) - f(X(w)) \mid < \epsilon 
$$
Hence, we know that $P(\mid X_n - X\mid < \delta ) \leq P(\mid f(X_n) - f(X) \mid < \epsilon )$, and since $X_n \rightarrow_p X$, then
$$
1 = \lim_{n \to \infty } P(\mid X_n - X\mid < \delta ) \leq \lim_{n\to \infty}P(\mid f(X_n) - f(X) \mid < \epsilon )
$$
Now, is the above solution correct? And how does one prove if $f$ is not uniformly continuous?
 A: Theorem: Let $(X_n)$ be a sequence of random variables. Then $X_n \to X$ in probability, iff for every subsequence $(n_k)$ there exists sub-subsequence $(n_{k_m})$ such that $X_{n_{k_m}} \to X$ almost surely.
Firstly lemma: If $X_n \to X$ in probability, then there exists subsequence $(n_k)$ such that $X_{n_k} \to X$ almost surely.
Proof of lemma: By convergence in probability, we have a subsequence $(n_k)$ such that $\mathbb P(|X_{n_k} - X| \ge \frac{1}{k^2}) \le \frac{1}{k^2}$. Hence $\sum_{k=1}^\infty \mathbb P(|X_{n_k} - X| \ge \frac{1}{k^2}) < \infty$ so by borel cantelli, almost surely we have $|X_{n_k} - X| < \frac{1}{k^2}$ starting from some $k>K$, so $X_{n_k} \to X$ almost surely.
Proof of theorem.
By Lemma we have => direction (since for any subsequence $(n_k)$ we have $X_{n_k} \to X$ in probability, too).
"<=" Assume contrary, that there $X_n \not \to X$ in probability. Hence by definition, there exists $\varepsilon >0, \delta >0$ and subsequence $(n_k)$ such that $\mathbb P(|X_{n_k} - X| > \varepsilon) > \delta$ for every $k \in \mathbb N$. But from that subsequence $(n_k)$ we cannot choose any sub-subsequence $(n_{k_m})$ such that $X_{n_{k_m}} \to X$ almost surely (because $X_{n_{k_m}} \not \to X$ in probability and this is necessary condition).
Having theorem we can proceed as follows in your question:
Let $f$ be continuous and $X_n \to X$ in probability. We want to show that $Y_n := f(X_n) \to f(X) =: Y$ in probability. Take any subsequence $(n_k)$. We know that there exists sub-subsequence $(n_{k_m})$ such that $X_{n_{k_m}} \to X$ almost surely. Hence $Y_{n_{k_m}} \to Y$ almost surely (cause continuous functions of pointwise convergent sequences are pointwise convergent). Since $(n_k)$ was arbitrary, by theorem we know that $Y_n \to Y$ in probability.
