Show $Y_n = f(X_n) \stackrel{P}{\rightarrow} Y=f(0)=1$ Problem
Let $X_n \stackrel{P}{\rightarrow}0,$ where $(X_n)_{n\geq 1}$ is a sequence of real-valued random variables, such that
$$P(X_n \neq 0) \rightarrow 0 \: for \: n\rightarrow \infty$$
and let
$$f:\mathbb{R} \rightarrow \mathbb{R}$$
such that
$$f(x)=\mathbb{1}_{\{0\}}(x)$$
Show $Y_n = f(X_n) \stackrel{P}{\rightarrow} Y=f(0)=1$
Attempt:
Using the definition:
$$\lim_{n\rightarrow \infty}P(|X_n-X|>\epsilon)=0$$
$$\lim_{n\rightarrow \infty}P(|Y_n-Y|>\epsilon)=\lim_{n\rightarrow \infty}P(|f(X_n)-f(0)|>\epsilon)=\lim_{n\rightarrow \infty}P(|f(X_n)-1|>\epsilon)=\lim_{n\rightarrow \infty}P(|f(X_n)|>\epsilon+1)=\lim_{n\rightarrow \infty}P(|X_n - 0|>f^{-1}(\epsilon+1))=0$$
I don't know if i'm in deep waters with the last equal sign...
Am i on the right track?

Notice that $Y_n$ takes the values $1$ and $0$, more precisely, $Y_n(\omega)=1$ if $X_n(\omega)\neq 0$ and $Y_n(\omega)=0$ if $X_n(\omega)= 0$. Therefore, for $0\lt\varepsilon\lt 1$,
\begin{align}
\mathbb P(\lvert Y_n-1\rvert>\varepsilon)&=\mathbb P\left(\{\lvert Y_n-1\rvert>\varepsilon\}\cap \{X_n=0\}\right)+\mathbb P\left(\{\lvert Y_n-1\rvert>\varepsilon\}\cap \{X_n\neq 0\}\right)&\mbox{ using }\mathbb P(A)=\mathbb P(A\cap B)+\mathbb P(A\cap B^c)\\
&=\mathbb P\left(\{\lvert Y_n-1\rvert>\varepsilon\}\cap \{X_n\neq 0\}\right)\\
&=\mathbb P(X_n\neq 0),
\end{align}
where the second equality follows from the fact that if $X_n= 0$, then $Y_n=1$ hence the events $\{\lvert Y_n-1\rvert>\varepsilon\}$ and $\{X_n=0\}$ are disjoint. The last equality follows from the fact that since $\varepsilon<1$, the event $\{X_n\neq 0\}$ is contained in $\{\lvert Y_n-1\rvert>\varepsilon\}$.
