(Another) issue with an elementary exercise on martingales Following a previous thread (Issue with elementary exercise on martingales) I have another issue on the same exercise on martingales (Exercise 14.4.1 Rosenthal's A First Look at Rigorous Probability Theory, Second Edition, page 173). Here is the exercise
Let ${Z_i}$ be i.i.d. with $P(Z_i=1)=P(Z_i=0)=1/2$.
Let $X_0=0,X_1=2Z_1-1$, and for $n>2$, $X_n=X_{n-1}+(1+Z_1+\dots+Z_{n-1})(2Z_n−1)$. (Intuitively, this corresponds to wagering, at each time n, one dollar more than the number of previous victories.)
Prove that $X_n$ is a martingale.
I have problems in proving integrability as the best I can get is:
$$\mathbb E[|X_n|]\leq \mathbb E[|X_{n-1}|]+\mathbb E[|2Z_n−1|]\sum_{j=1}^{n-1}\mathbb E[|Z_j|]=\mathbb E[|X_{n−1}|]+n\,,$$
and not $$\mathbb E[|X_n|]\leq \mathbb E[|X_{n−1}|]$$ as in the answer of the previous thread. Am I missing something?
 A: For all $i$, we have $Z_i=0$ or $Z_i=1$, hence  $|2Z_i-1|=1$ and also $|Z_i|\le 1$.

Applying the plan of action outlined in your comment . . .

For each positive integer $n$ we have
\begin{align*}
|X_n|
&=
\left|X_{n-1}+\left(1+\sum_{i=1}^{n-1}Z_i\right)\bigl(2Z_n-1\bigr)\right|
\\[4pt]
&\le
\bigl|X_{n-1}\bigr|+\left(1+\sum_{i=1}^{n-1}|Z_i|\right)\Bigl|2Z_n-1\Bigr|
\\[4pt]
&\le
\bigl|X_{n-1}\bigr|+\bigl(1+(n-1)\bigr)(1)
\\[4pt]
&\le
\bigl|X_{n-1}\bigr|+n
\\[4pt]
\end{align*}
and then, since $X_0=0$, induction on $n$ yields
$$
|X_n|\le\sum_{i=1}^n i
\qquad\qquad\qquad\qquad\qquad\qquad\;\;\;
$$
hence
$$
E|X_n|\le\frac{n(n+1)}{2} < \infty
\qquad\qquad\qquad\qquad\;\;\;
$$
Next consider the conditional expectation $E(X_n|X_1,...,X_{n-1})$.

By a routine induction on $n$, it's easily shown that the values of $Z_1,...,Z_n$ are completely determined by the values of $X_1,...,X_n$.

Also we have
$$
P(2Z_n-1=1)=\frac{1}{2}=P(2Z_n-1=-1)
$$
so we get
\begin{align*}
E(X_n|X_1,...,X_{n-1})
=\;
&E(X_n|Z_1,...,Z_{n-1})
\\[6pt]
=\;
&\Bigl(\frac{1}{2}\Bigr)
\Bigl(X_{n-1}+(1+Z_1+\cdots+Z_{n-1})\Bigr)\\[0pt]
&\;\;+\\[0pt]
&\Bigl(\frac{1}{2}\Bigr)
\Bigl(X_{n-1}-(1+Z_1+\cdots+Z_{n-1})\Bigr)
\\[6pt]
=\;
&X_{n-1}
\\[4pt]
\end{align*}
hence $X_1,X_2,X_3,...$ is a martingale.
