Expected value of a random variable at a stopping time. Let $x_1,x_2 \dots$ be adapted to the filtration $\mathcal{F}_1, \mathcal{F}_2, \dots$.
Let $\tau$ be a stopping time that is also adapted to the filtration. 
  Say that 
$\mathbb{E}[x_i \mid \mathcal{F}_{i-1}] = 0$.
Is it true that
  $$\mathbb{E}[x_{\tau}] = 0?$$
One idea I had was to write $x_{n} = x_0 + (x_1 - x_0) + \dots + (x_{n}- x_{n-1}) = x_0 + \sum\limits_{i=1}^{n}z_i$ where $z_i = x_{i} - x_{i-1}$.
I thought perhaps the partial sums $S_n = \sum\limits_{i=1}^{n}z_i$ could be a martingale, and I could use the optional sampling theorem, but it doesn't seem to be the case.

Suppose $\tau$ is finite with probability one. Then $$ \mathbb E x_{\tau} = \mathbb E [ \mathbb E[x_\tau | \tau]] = \sum_n \mathbb E [x_\tau | \tau = n]P(\tau = n) $$
If $\tau$ is not finite, i.e. $P(\tau <\infty) <1$, then let $N$ be a positive integer and let $\tau_N := \min(\tau,N)$. Then $\tau_N$ is finite with probability 1, due to Fatou's lemma
$$ \mathbb E[x_\tau I(\tau<\infty)] = \mathbb E[\liminf_N x_{\tau_N} ]\le \liminf_N \mathbb E[x_{\tau_N}]. $$ 
