Let $(\Omega,\mathscr A,\mathscr F_n,\mathbb P)$ be a filtered probability space and $\tau$ be an $\mathscr F_n$ stopping time. $\mathscr F_n$ is discretely indexed.
Show that $X:\Omega \to \mathbb R$ is measurable with respect to the stopped sigma algebra $\mathscr F_\tau$ if and only if $$X(\omega)=\sum_{n=1}^\infty Y_n(\omega)1_{\{\tau =n\}}(\omega).$$ for an $\mathscr F_n$ adapted process $Y_n$.
Showing $X$ of that form is $\mathscr F_\tau$ measurable is more or less straightforward. $\tau$ is $\mathscr F_\tau$ measurable and indicators on measurable sets are measurable. $Y_n$ is adapted and taking intersection gives the result. For the other direction, how can I find the $Y_n$?