Is the hypothesis of a theorem that convergence in law implies convergence in probability incorrect? I'm reading the proof of below theorem

Let $X$ be a random variable and $\left\{X_{n}\right\}$ be a sequence of random variables on the probability space $(\Omega, \mathcal{F}, \mathbb{P})$.

*

*$X_{n} \rightarrow X$ in probability if $\mathbb{P}\left(\left|X_{n}-X\right|>\varepsilon\right) \rightarrow 0$ as $n \rightarrow \infty$ for every $\varepsilon>0$.


*$X_{n} \rightarrow X$ in law (or in distribution, or weakly) if $\mathbb{E}\left(f\left(X_{n}\right)\right) \rightarrow \mathbb{E}(f(X))$ for every bounded continuous function $f$.
Prove that $X_{n} \rightarrow X$ in probability implies $X_{n} \rightarrow X$ in law.

Here is the proof:

It seems to me the existence of $\delta$ such that $$\left|f\left(X_{n}\right)-f(X)\right|>\varepsilon \implies \left|X_{n}-X\right|>\delta, \quad n \in \mathbb N$$ can not be obtained just by the continuity of $f$. Instead, it would follow if only the uniform continuity is assumed. Hence, the correct hypothesis should be

"... for every bounded and uniformly continuous function $f$"

Could you check if my understanding is correct?
 A: The proof given is wrong. It does assume uniform continuity. However, the statement itself is correct.
One proof uses the fact that convergence in probability implies almost sure convergence for a subsequence. Combined with DCT this gives a proof.
Hints for an alternative proof: There exist $M$ such that $P(|X| >M) <\epsilon$. There exists $n_0$ such that $P(|X_n-X| >1) <\epsilon$ for $n \geq n_0$. Combine these two to get $P(|X_n| >M+1) <2\epsilon$ for $n \geq n_0$. Now $$\begin{aligned} &E|f(X_n)-f(X)|\\={}&E|f(X_n)-f(X)|I_{|X_n| \leq M+1,|X| \leq M+1}+E|f(X_n)-f(X)|I_{|X_n| > M+1 \,\,\text {OR}\,\,|X| > M+1}.\end{aligned}$$
In the first term use uniform continuity of $f$ on $[-M-1,M+1]$. In the second term use a bound on $|f|$. I hope you can finish the proof now.
A: I fill in @Kavi's proof here to deepen my understanding.

Assume that $f(x) \le K$ for all $x$.

*

*Given $\varepsilon > 0$, there exists $a > 0$ such that  $\mathbb P ( |X| > a ) < \varepsilon$ by Chebyshev's inequality.


*Given $b > 0$, there is $N \in \mathbb N$ such that $\mathbb P( |X_n-X| > b ) < \varepsilon$ for all $n \ge N$.
Because $|X_n| \le |X_n - X| + |X|$, we get $|X_n| > a+b$ implies $|X_n - X|>b$ or $|X| > a$. Then $$\mathbb P (|X_n| > a+b) \le \mathbb P ( |X_n - X|>b) + \mathbb P (|X| > a ) < 2 \varepsilon.$$
Let $Y_n = f(X_n)-f(X)$. Now we decompose $\mathbb E|Y_n|$ into separate parts, i.e.,
$$\mathbb E|Y_n| = \mathbb E \left (|Y_n| I_{|X|, |X_n| \le a+b} \right ) + \mathbb E \left (|Y_n| I_{|X| > a+b \text{ or } |X_n| > a+b} \right ) = E_1+E_2.
$$
Notice that on the the interval $[-(a+b), a+b]$, $f$ is uniformly continuous. On this interval, given $c>0$ there is $\delta$ such that $|X_n-X| \le \delta \implies |Y_n| \le c$ or equivalently $|Y_n| > c \implies |X_n-X| > \delta$. Then $$\begin{aligned}
E_1 &= \mathbb E \left (|Y_n| I_{|X|, |X_n| \le a+b \text{ and } |Y_n| \le c} \right ) + \mathbb E \left (|Y_n| I_{|X|, |X_n| \le a+b \text{ and } |Y_n| > c} \right ) \\
&\le \mathbb E \left (|Y_n| I_{|X|, |X_n| \le a+b \text{ and } |Y_n| \le c} \right ) + \mathbb E \left (|Y_n| I_{|X|, |X_n| \le a+b \text{ and } |X_n-X| > \delta} \right ) \\
&\le c + 2K \mathbb P \left ( |X_n-X| > \delta \right ).
\end{aligned}$$
For all $n \ge N$, we have $$\begin{aligned}
E_2 & \le 2K \left ( \mathbb P (|X| > a+b) + \mathbb P ( |X_n| > a+b ) \right ) \\
& \le 2K \left ( \mathbb P (|X| > a) + \mathbb P ( |X_n| > a+b ) \right ) \\
& \le 6\varepsilon K.
\end{aligned}$$
It follows that $$|\mathbb E (Y_n) | \le \mathbb E (|Y_n|) \le c + 2K \mathbb P \left ( |X_n-X| > \delta \right ) + 6\varepsilon K, \quad n \ge N.$$
So $$\lim_{n \to \infty} |\mathbb E (Y_n) | \le c + 6\varepsilon K.$$
Above inequality holds for any $\varepsilon, c>0$ and thus $\lim_{n \to \infty} |\mathbb E (Y_n) | = 0$. This completes the proof.
