Solution (source code)

= Solution

The <adapted process> is bounded by $1$, so every $X_n$ is an <integrable random variable>, indeed a <square-integrable> <random variable>. <Independence> of $U_{n+1}$ from $\mathcal F_n$ and its <continuous uniform distribution> give
$$
\mathbb E[B_{n+1}\mid\mathcal F_n]=X_n.
$$
This calculation with a random threshold is justified by conditioning on the $\mathcal F_n$-<measurable> value of $X_n$: for a fixed $t\in[0,1]$, the <Lebesgue integral> $\int_0^1\mathbf1_{\{u\leq t\}}\,du$ equals $t$. More formally, <independence> integrates the bounded <Borel measurable function> $(t,u)\mapsto\mathbf1_{\{u\leq t\}}$ over its second coordinate. Therefore
$$
\mathbb E[X_{n+1}\mid\mathcal F_n]
=\tfrac12X_n+\tfrac12\mathbb E[B_{n+1}\mid\mathcal F_n]=X_n,
$$
which verifies the <martingale> property for this <filtration>.

Since $B_{n+1}^2=B_{n+1}$, the <conditional expectation> of the squared <martingale difference> is
$$
\begin{aligned}
\mathbb E[(X_{n+1}-X_n)^2\mid\mathcal F_n]
&=\tfrac14\mathbb E[(B_{n+1}-X_n)^2\mid\mathcal F_n]\\
&=\tfrac14(X_n-2X_n^2+X_n^2)
=\tfrac14X_n(1-X_n).
\end{aligned}
$$
The <law of total expectation> yields \b[$\mathbb E[(X_{n+1}-X_n)^2]=\frac14\mathbb E[X_n(1-X_n)]$]. In particular, $\mathbb EX_n=x$ for every $n$.