Understanding of stopping times I struggle with the understanding of stopping times. Could someone check whether what I wrote is correct and answer my question:

If $(X_n)$ is a martingale adapted to a filtration $(\mathcal{F}_n)$, then from the property $E[X_{n+1}\mid\mathcal{F}_n]=X_n$ and the law of total expectation we have for $s,t\in \mathbb{N}$ and $s<t$
  $$E[X_{t}\mid\mathcal{F}_n]=E[E[X_{t}\mid\mathcal{F}_{t-1}]\mid\mathcal{F}_n]=\dots=X_s$$
  hence $E(X_t)=E(X_s)$
However if $T$ is a stopping time, then $E(X_T)=E(X_s)$ is not always true but the optional stopping theorem gives us the conditions when it is true. For example if $T<\infty \quad a.s.$

Now I came across this example:

Let $X_n$ with $\mathbb{P}[X_i = 1] = 1/2$ and $\mathbb{P}[X_i = -1] = 1/2$ and $X_i$ are i.i.d. Let $\tau=\inf\{n: X_n =1\}$, then $\mathbb{E}[X_{\tau}]=1$ but $E(X_0)=0$.

So this must mean $\tau$ is not finite, how do I see this? And how do I correctly compute $E[X_{\tau}]$? Intuitively it is clear, but I'm unable to show this.
 A: First let me correct an apparent misconception:
The classic example when the optional stopping theorem does not apply is the "martingale betting strategy". This is described by the martingale $X_n=\sum_{k=0}^n Y_k$ where $Y_k$ are independent and equally likely to be $2^k$ and $-2^k$. In this case, with $\tau=\inf \{ k : Y_k>0 \}$, you have $X_\tau=1$ a.s., yet $E[X_0]=0$.
This example shows that $T<\infty$ a.s. is not enough to have an optional stopping theorem type result. One version of the optional stopping theorem requires $T<M$ a.s. for some finite $M$.
With that said, let me return to your actual question:
Your example is simply not a martingale. In fact, the only sequence of iid mean zero random variables which forms a martingale is a sequence of constant zero r.v.s (check it). However, a sum of iid mean zero random variables does form a martingale. In fact if you sum up your $X_i$ you will find that the optional stopping theorem applies (this is the standard "gambler's ruin" when the bet size is fixed).
