Assume $(M_n)_{n\in\mathbb{N}}$ is a martingale and $\tau \leq \rho$ bounded stopping times. I want to prove that $\mathbb{E}[M_{\rho}]=\mathbb{E}[M_{\tau}]$.
This result looks very similar to the optional stopping theorem and indeed the proof is done in the same manner. However, I was thinking why the following does not hold:
We know that for almost all $\omega \in \Omega$, $\tau(\omega) \leq \rho(\omega)$ holds and therefore $$ \mathbb{E}[M_{\rho(\omega)}| \mathcal{F}_{\tau(\omega)}](\omega)=M_{\tau(\omega)}(\omega) $$ by the martingale property (which again holds for almost all $\omega$). Now taking the expectation on both sides, i.e. integrating w.r.t. the given probability measure, this yields $\mathbb{E}[M_{\rho}]=\mathbb{E}[M_{\tau}]$.
This is cannot be true, since one could prove the optional stopping theorem in the same way, without using boundedness of the stopping time. So what is my mistake in the proof above? Thanks.
Your proof is correct.
The boundness of the stopping times is needed in optional stopping theorem because the martingale $M=(M_n)$ may not converge as $n\to\infty$. In other words, if the martingale $M_n$ does not converge as $n\to\infty$ and also the stopping time $\tau$ is unbounded, then the random variable $M_{\tau(\omega)}(\omega)$ cannot be well-defined at those $\omega$ satisfying $\tau(\omega)=\infty$.