Give an example with $X_n\in \{0,1\}$, $X_n\to 0$ in probability, $N(n)\uparrow \infty$ a.s., and $X_{N(n)}\to 1$ a.s.
Let $P(X_n=0)=p_n$. Here $\epsilon,\delta>0$
$P(|X_n|>\epsilon)\to 0$.
Now, $P(X_n>\epsilon)=1-p_n$, if $\epsilon<1$, otherwise $0$. Then, $p_n\to 1$
$P(|X_n-1|>\epsilon)=P(X_n<1-\epsilon)=p_n$, if $\epsilon<1$, otherwise $0$.
I need to find $N(n)$ such that $\sum_{n=1}^{\infty}P(|X_{N(n)}-1|>\delta)< \infty$
So, basically I need to think about $\delta<1$. But could not find how to proceed. Thanks for any hint.
Find $X_n$, using Borel-Cantelli, such that $\fbox{1}~ \mathbb{P}(X_n=1 \text{ i.o.})=1$.
Then define $N(n)=\inf\{k>n| X_{k}=1 \}$. Equation $\fbox{1}$ implies that $N(n)<\infty$ almost surely, therefore $X_{N(n)}=1$ almost surely. Also, since $N(n)>n$, $N(n)\rightarrow\infty$ almost surely.