Solution (source code)

= Solution

The increments of $Y_n=M_{n\wedge T}$ satisfy
$$
Y_n-Y_{n-1}
=\mathbf1_{\{T\geq n\}}(M_n-M_{n-1}).
$$
Since $\{T\geq n\}=\{T>n-1\}\in\mathcal F_{n-1}$, the indicator is predictable. Part (a), applied to this bounded integrand, shows that $Y$ is a martingale. Equivalently, this is the <stopped martingale> theorem.