Find the limit of a random variable 
I'd like to find distribution of the almost sure limit $X_\infty$ of 
$X_{t+1}=
 \begin{cases}  
      1-p+pX_t & \text{w/prob: } X_t \\
      pX_t & \text{w/prob: } 1-X_t
   \end{cases}$ 
where $X_t$ is a random variable (and also a martingale), and $p\in [0,1]$. 

Firstly, to show it converges a.s., i need to show $P(\lim \sup X_n = \lim \inf X_n)=1.$ (Which i guess makes sense intuitively, as sup $X_n$ is evaluated when $X_n=1$ and inf $X_n$ when $X_n=0$, right?)
Then i'm not sure how to  take the limit for any $\omega \in \Omega$, i.e. $\underset{n \to \infty}{\lim} X_n(\omega)$.. i guess looking at probabilites since it is discrete and applying Borel Cantelli or something? 
 A: Hint:
You should Show $E(X_{\infty}(1-X_{\infty}))= 0$ and since  $X_{\infty}(1-X_{\infty})\geq 0$ conclude almost sure $X_{\infty} \sim Bernoulli (x_0)$(Since $E(X_t)=x_0$).
1)  $X_t$ is a non-negative martingale, so it converge almost surly.Corollary 2.3. so $ \lim \sup X_n = \lim \inf X_n=X_{\infty}$
2)show $E(X_{t+1}-X_t)^2 \longrightarrow 0$ when $t\longrightarrow \infty$.
3)Show $E(X_{t+1}-X_t)^2=(1-p)^2  E(X_t(1-X_t))$ and hence $E(X_t(1-X_t))\longrightarrow 0$ when $t\longrightarrow \infty$.
Now by $t\longrightarrow \infty$ so $ E(X_{\infty}(1-X_{\infty}))= 0$ almost surly. 
since $X_t(1-X_t)\geq 0$ so almost sure $X_{\infty}(1-X_{\infty})=0$. So $X_{\infty}=0$ or $X_{\infty}=1$.
use the fact  $E(X_t)=x_0$ so $X_{\infty} \sim Bernoulli (x_0)$
Proof $E(X_{t+1}-X_t)^2=(1-p)^2  E(X_t(1-X_t))$.
$E\left((X_{t+1}-X_t)^2\mid X_t\right)=(1-p+pX_t-X_t)^2\times X_t+(pX_t-X_t)^2\times (1-X_t)=(1-p)^2(1-X_t)^2\times X_t+(1-p)^2\times X_t^2 (1-X_t)
=(1-p)^2(1-X_t)\times X_t\left( (1-X_t) +X_t  \right)=(1-p)^2(1-X_t)\times X_t$
So
$E(X_{t+1}-X_t)^2=(1-p)^2  E(X_t(1-X_t))$
