Recursive martingale 
Let $X_0=x_o \in [0,1]$ and $(X_n)_n$ a stoch. process s.t 
$X_{n+1}= $$\begin{cases}
\frac{1}{2} + \frac{X_n}{2}, \quad \text{with prob. } X_n \\
\frac{X_n}{2},\quad \text{with prob. } 1-X_n
\end{cases} $
Prove:
i)$(X_n)_n$ is a martingale
ii) $(X_n)_n$ converges almost surely


i) I consider the natural filtration $F_n= \sigma (X_1, \ldots, X_n)$. By definition, $X_n$ is $F_n$ adapted for every $n$.
I check the martingale property: $E[X_{n+1}|F_n]$. But in the expression of $X_{n+1}$ I have just terms with $X_n$, which I know since I am conditioned to $F_n$, i.e. I know all the values, so $X_{n+1}$ is $F_n$ measurable and hence $E[X_{n+1}|F_n]=E[X_{n+1}]=\frac{X_n}{2}+\frac{X_n^2}{2}+\frac{X_n}{2}-\frac{X_n^2}{2}=X_n$.
ii) I think I have the apply the "martingale convergence thm". More specifically, I need to check that 
\begin{align}
\sup_n E[|X_n|] < \infty
\end{align} 
in order to conclude that $X_n$ converge a.s. to a $F_{\infty}$-measurable r.v. $X$
Now, 
\begin{align}
E[|X_{n+1}|]=|\frac{1+X_n}{2}|X_n + \frac{|X_n|}{2}(1-X_n), \quad \star
\end{align}
and I'd like to show it's bounded. The key point is (I guess) to find the recurrence relation between $X_{n+1}$ and $X_0=x_0 \in [0,1]$, but I can't see it (in particular for the first term).
I found the relations: 
$\bullet$ $X_{n+1}=\frac{1}{2}+ \frac{1}{2^n}+\frac{1+x_0}{2^{n+1}}$ with prob. $\frac{x_0}{2^n}$
$\bullet$ $X_{n+1}=\frac{x_0}{2^{n+1}}$, with prob. $1 - \frac{x_0}{2^n}$
and so each one of the summand in $\star$ is bounded, so the supremum over $n \in \mathbb{N}$ is also bounded, hence by the martingale convergence theorem applies. 
Is everything okay?
 A: I think you are skipping some non-trivial steps here. First, it is not readily apparent that $X_n$ is integrable. From the definition of $X_1$, we see that its minimum value is zero (attained at $x_0=0$ with probability one) and its maximum value is one (attained at $x_0=1$ with probability one). Then, assuming $0\leqslant X_n\leqslant 1$, we have by a similar argument that $0\leqslant X_n\leqslant1$, so by induction $0\leqslant X_n\leqslant 1$ for all $n$. It follows then that
\begin{align}
\mathbb E[|X_n|] &= \mathbb E[X_n]\\
&= (1/2 + X_n/2)X_n + X_n/2(1-X_n)\\ &\leqslant (1/2+1/2)\cdot 1 + 1/2\cdot 1\\ &= 5/2\\&<\infty.
\end{align}
Your verification of the martingale property is correct.
As for convergence, I believe my argument above suffices for Doob's martingale convergence theorem. (Technically the condition is $\sup_n \mathbb E[X_n^-]<\infty$ but $\mathbb P(X_n\geqslant0)$ here so we need not consider the negative part of $X_n$.)
A: A much simpler approach: verify by induction that $0\leq X_n \leq 1$ for all $n$. Obviously this implies a.s. convergence. 
