Solution (source code)

= Solution

For bounded stopping times $S\wedge n\leq T\wedge n$, the <optional sampling theorem for a supermartingale> gives
$$
\mathbb E[X_{T\wedge n}]=\mathbb E[X_{S\wedge n}]=\mathbb E[X_0].
$$
A stopped family drawn from a uniformly integrable martingale is uniformly integrable. Since $X_{T\wedge n}\to X_T$ and $X_{S\wedge n}\to X_S$ almost surely, <uniform integrability> upgrades both convergences to $L^1$. Passing to the limit yields
$$
\mathbb E[X_T]=\mathbb E[X_S].
$$