I have encountered the following line in a proof from Durrett's Probability Theory and Examples. Here, we have $f$ continuous and $P(Y_\infty \in D_g)=0$ $D_g = \{x: g \;\text{is discontinuous at }\; x\}$.
If $Y_n \to Y_\infty$ a.s. and $P(Y_\infty \in D_{f \circ g})=0$ then $f(g(Y_n)) \to f(g(Y_\infty))$ a.s.
How does this implication hold?
If $Y_n \to Y_\infty$ a.s., then $Y_n(\omega) \to Y_\infty(\omega)$ for all $\omega$ in a set $F$ with $P(F)=1$. Consider the set $G = F \cap (Y_\infty \in D_{f \circ g})^c$. If $\omega \in G$, then $Y_n(\omega) \to Y_\infty(\omega)$ and $f \circ g$ is continuous at $Y_\infty(\omega)$, hence $f(g(Y_n(\omega))) \to f(g(Y_\infty(\omega)))$. Finally, note that $P(G)=1$.