Let $\{\xi_i\}^\infty_{i=0}$ be a sequence of real valued jointly distributed random variables that satisfy $E[\xi_i|\xi_0,\xi_1,...,\xi_{i-1}]=0,\;i=1,2,...$ Define $$X_0=\xi_0,\quad X_{n+1}=\sum^n_{i=0}\xi_{i+1}f_i(\xi_0,\xi_1,...,\xi_i)$$ where $f_i$ are a prescribed sequence of functions of $i+1$ real variables. Show that $\{X_n\}$ form a martingale.
We want to show that $E[X_{n+1}|\mathcal{F}_n]=X_n$. \begin{align} E[X_{n+1}|\mathcal{F}_n]&=E[\sum^n_{i=0}\xi_{i+1}f_i(\xi_0,\xi_1,...,\xi_i)|\mathcal{F}_n]\\ &=\sum^n_{i=0}E[\xi_{i+1}f_i(\xi_0,\xi_1,...,\xi_i)|\mathcal{F}_n]\\ &=\sum^n_{i=0}f_i(\xi_0,\xi_1,...,\xi_i)E[\xi_{i+1}|\mathcal{F}_n] \end{align}
The part that I am stuck on is what to do with the sequence $f_i$. I can see that it has something to do with $E[\xi_i|\xi_0,\xi_1,...,\xi_{i-1}]=0$, but how do I use this to conclude that it equals $X_n$. Also, do we have to figure out what $X_n$ is from $X_{n+1}$ since it is not given?
Denote by $\mathcal F_n$ the natural filtration of $X_n$.
Suppose that $\mathcal G_n = \sigma(\xi_0, \xi_1, \ldots, \xi_n)$. In this case $f_n(\xi_0,\xi_1,...,\xi_n)$ are $\mathcal{G}_n$ - measurable and $$E[\xi_{n+1}f_n(\xi_0,\xi_1,...,\xi_1)|\mathcal{G}_n] = f_n(\xi_0,\xi_1,...,\xi_n) E[\xi_{n+1}|\mathcal{G}_n] = 0.$$ Thus $E[X_{n+1} - X_n|\mathcal{G}_n] = 0$ or equivalently $E[X_{n+1}|\mathcal{G}_n] = X_n$.
Hence $X_n$ is a martingale with respect to $\mathcal{G}_n$.
Finally we use the next fact, which may be easily checked: if $X_n$ is a martingale with respect to $\mathcal{G}_n$ then $X_n$ is a martingale with respect to it's natural filtration $\mathcal F_n$.