Let $X_n$ be iid r.v.s such that $P(X_n=1)=P(X_n=-1)=1/2$, and $S_n=\sum_{k=0}^{n}X_k$. Define $S_0=0$ a.s. . Prove that for all $k,n \in \mathbb{N}$, $\mathbb{E}[S^2_{n \wedge T_k}]=\mathbb{E}[{n \wedge T_k}]$, where $T_k=inf \{n \in \mathbb{N_0}: S_n=k \}$ is a stopping time w.r.t. filtration $\mathcal{F}_n= \sigma(X_1,...,X_n)$.
If relevant, in the earlier part of the same question we showed that $M_n=S^2_n-n$ is a martingale.