Attempting to show $P(|S_n| <1)$ for a martingale $(S_n)$ 
Now, I am stuck on the last part of the question. I managed to find the solutions, but I don't udnerstand them completely.

What I don't understand is: How they got that indicator function, and why they are using double expectation to calculate the probability. I'd appreciate it if someone coudl help out, thanks.
 A: First, we can show the function $f:\mathbb{R}\to \mathbb{R}$ given by $f(x)=\sqrt{1+x^2}$ is such that:


*

*$\forall x,f(x)\geq 1$. Also $f(x)=1\iff x=0$.

*$x< 0 \implies 0<x+f(x)<1$. Similarly $x>0\implies -1<x-f(x)<0$ 


Second, to prove
$$
1_{\{|S_n|<1\}}=\frac{-X_nsign(S_{n-1})+1}{2} 
$$
note this: 
\begin{eqnarray}
\frac{-X_nsign(S_{n-1})+1}{2} =1 & \iff & -X_nsign(S_{n-1})=1\\
& \iff & (X_n=-1\:\wedge\:S_{n-1}>0)\vee(X_n=1\:\wedge\:S_{n-1}<0)\\
& \implies & |S_n|<1
\end{eqnarray}
(the last line is consequence of the second property of $f(x)$ previously mentioned). On the other hand
\begin{eqnarray}
\frac{-X_nsign(S_{n-1})+1}{2} =0 & \iff & -X_nsign(S_{n-1})=-1\\
& \iff & (X_n=-1\:\wedge\:S_{n-1}<0)\vee(X_n=1\:\wedge\:S_{n-1}>0)\\
& \implies & |S_n|>1
\end{eqnarray}
(the last line is consequence of the first property of $f(x)$ previously mentioned). 
Third, by the previous point
$$
\mathbb{P}[|S_n|<1]=\mathbb{E}[1_{\{|S_n|<1\}}]=\mathbb{E}[(-X_nsign(S_{n-1})+1)/2]
$$
in other words, computing the desired probability is the same as computing 
$
\mathbb{E}[(-X_nsign(S_{n-1})+1)/2]
$. Computing this directly looks pretty tedius (you'd need to compute the distribution of $X_nsign(S_{n-1})$, etc). Luckily, using the Law of total expectation, the conditional expectation 
$$
Y_{n-1}:=\mathbb{E}[(-X_nsign(S_{n-1})+1)/2|\mathcal{F}_{n-1}]
$$
verifies:
$$
\mathbb{E}[(-X_nsign(S_{n-1})+1)/2]=\mathbb{E}[\mathbb{E}[(-X_nsign(S_{n-1})+1)/2|\mathcal{F}_{n-1}]=\mathbb{E}[Y_{n-1}]
$$
Hence
$$
\mathbb{P}[|S_n|<1]=\mathbb{E}[\mathbb{E}[(-X_nsign(S_{n-1})+1)/2|\mathcal{F}_{n-1}]
$$
and since $S_{n-1}\in \mathcal{F}_{n-1}$ and $X_n$ is independent of $\mathcal{F}_{n-1}=\sigma(X_1,...,X_{n-1})$, by properties of conditional expectation we deduce 
$$
Y_{n-1}=\mathbb{E}[(-X_nsign(S_{n-1})+1)/2|\mathcal{F}_{n-1}]=\frac{\mathbb{E}[X_n]sign(S_{n-1})+1}{2}=\frac{1}{2}
$$
hence 
$$
\mathbb{E}[(-X_nsign(S_{n-1})+1)/2]=\mathbb{E}[Y_{n-1}]=1/2
$$
