Setup:
$W$ probability space
$Z_i : W \to L_i $ random variables ($L_i$ finite, for example $\{0,1\}$)
$f: Z_1 \times \ldots \times Z_n \to \mathbb{R}$
$X_i := \mathbb{E}[f \mid Z_1,..,Z_i]$
Why is $X_1,\ldots,X_n$ a martingale?
For beeing a martingale it has to fulfill
$\mathbb{E}[X_{i+1} \mid X_1,..,X_i] = X_i$
so I have to show (because $X_i$ is determined by $Z_1,\ldots,Z_i$
$\mathbb{E}[X_{i+1} \mid X_1,\ldots,X_i] = \mathbb{E}[X_{i+1} \mid Z_1\ldots,Z_i] = \mathbb{E}[ \mathbb{E}[f \mid Z_1,\ldots,Z_{i+1}] \mid Z_1\ldots,Z_i]= \ldots =\mathbb{E}[F\mid Z_1,\ldots,Z_i]=X_i$
I don't get the "intention" behind it…the conditional expectation of the conditional expectation of $f$ (knowing $Z_1,\ldots,Z_{i+1}$) knowing $Z_1,\ldots,Z_i$ is the conditional expectation of $f$ knowing $Z_1,\ldots,Z_i$ ???