Let $\tau=\min \left\{t: X_t=3\right\}$. Using the the fact that $\tau$ is a stopping time satisfying $\mathbb{P}(\tau<\infty)=1$, prove the following relation: $$ \mathbb{E}\left[\alpha^\tau\right]=\left(\frac{1-\sqrt{1-\alpha^2}}{\alpha}\right)^3, \text { for any constant } \alpha \in(0,1) $$
where $X_0=0$ and $$ X_t=Z_1+\cdots+Z_t . $$ and $Z_1, Z_2, \ldots$ be a sequence of i.i.d. (independent and identically distributed) random variables with $$ \mathbb{P}\left(Z_i=1\right)=\mathbb{P}\left(Z_i=-1\right)=1 / 2, $$
Assume: $\mathcal{F}_0=\{\emptyset, \Omega\}$ and $\forall t \in \mathbb{N}^*, \mathcal{F}_t=\sigma\left(Z_1, \ldots, Z_t\right)$.
I'm stuck on this problem that I can't solve, any help is welcome. I think I should probably use Optional Sampling Theorem but I dont know how to proceed.
We should use the Doob's optional sampling theorem that you mentionned.
First, we need to construct a martingale $S_t$, I suggest $$\color{red}{S_t=\underbrace{c^{-X_t}}_{\text{(1)}}\cdot \underbrace{\alpha^t}_{(2)}}$$
$S_t$ is martingale if and only if $$\begin{align} \mathbb{E}(S_t |\mathcal{F}_{t-1}) = S_{t-1} &\iff \mathbb{E}(c^{-Z_t}\cdot\alpha |\mathcal{F}_{t-1})=1 \\ &\iff \frac{\alpha}{2}\left( c+ \frac{1}{c} \right)=1 \\ &\iff c = \frac{1}{\alpha} \pm \sqrt{\frac{1}{\alpha^2}-1} \end{align}$$ So, it suffices to choose $c = \frac{1}{\alpha} \color{red}{-} \sqrt{\frac{1}{\alpha^2}-1}$ so that $S_t$ is martingale. Besides, with this choice, it's easy to find that $0<c<1$ and then $$S_{t\wedge\tau} = c^{-X_{t\wedge\tau}}\underbrace{\alpha^{t\wedge\tau}}_{<1}<c^{-X_{t\wedge\tau}} \le \left(\frac{1}{c}\right)^{3} \hspace{1cm} \text{ because }\frac{1}{c}>1$$ and so the condition $(c)$ of Doob's optional sampling theorem is satisfied.
Applying the theorem, we have:
$$\begin{align} 1 = S_0 = \mathbb{E}(S_\tau) &= \mathbb{E}(c^{-X_\tau}\alpha^\tau) =\mathbb{E}(c^{-3}\alpha^\tau) \end{align}$$
or $$\color{red}{\mathbb{E}(\alpha^\tau) = c^3 = \left(\frac{1-\sqrt{1-\alpha^2}}{\alpha}\right)^3}$$
Q.E.D