Consider $(X,M_X),(Y,M_Y),(Z,M_Z)$ measurable spaces, namely $M_X,M_Y,M_Z$ are $\sigma$-algebras.
Consider $f\colon X \to Y$, $g\colon Y \to Z$.
Suppose that $f$ is $(M_X,M_Y)$-measurable (namely $\forall \,A \in M_Y \quad f^{-1}(A) \in M_X$), and that $g$ is $(M_Y,M_Z)$-measurable.
Now consider $h=g \circ f\colon X \to Z$.
Is $h$ $(M_X,M_Z)$-measurable?
$ $
My attempt is the following:
$\forall \,A \in M_Z \quad h^{-1}(A)=f^{-1}(g^{-1}(A)) \in M_X$, since $f,g$ are measurable.
So $h$ is $(M_X,M_Z)$-measurable.
Am I wrong? Thank you!
Perhaps rewording it in the following way is better:
We want to show that $g\circ f$ is measurable. Let $B\in M_Z$. Then $(g \circ f)^{-1}(B)=f^{-1}(g^{-1}(B))$. As $g$ is measurable, $g^{-1}(B)\in M_Y$. As $f$ is measurable, $f^{1}(g^{-1}(B))\in M_X$. Hence the composition is measurable.