[proofplan]
The proof is a direct computation with preimages. Measurability of a map $h: X \to Z$ means $h^{-1}(H) \in \mathcal{F}$ for every $H \in \mathcal{H}$. Since $(g \circ f)^{-1}(H) = f^{-1}(g^{-1}(H))$ and the two measurability hypotheses guarantee that $g^{-1}(H) \in \mathcal{G}$ and then $f^{-1}(\cdot)$ sends $\mathcal{G}$-sets to $\mathcal{F}$-sets, the result follows.
[/proofplan]
[step:Decompose the preimage of the composition and apply both measurability hypotheses]
Let $H \in \mathcal{H}$. We must show $(g \circ f)^{-1}(H) \in \mathcal{F}$. By the definition of the composition and the set-theoretic identity for preimages of composed maps,
\begin{align*}
(g \circ f)^{-1}(H) = \{x \in X : g(f(x)) \in H\} = \{x \in X : f(x) \in g^{-1}(H)\} = f^{-1}\!\bigl(g^{-1}(H)\bigr).
\end{align*}
Since $g: Y \to Z$ is $(\mathcal{G}, \mathcal{H})$-measurable, the set $g^{-1}(H)$ belongs to $\mathcal{G}$. Since $f: X \to Y$ is $(\mathcal{F}, \mathcal{G})$-measurable, the preimage under $f$ of any $\mathcal{G}$-set belongs to $\mathcal{F}$. Applying this to the $\mathcal{G}$-set $g^{-1}(H)$, we obtain $f^{-1}(g^{-1}(H)) \in \mathcal{F}$.
Therefore $(g \circ f)^{-1}(H) \in \mathcal{F}$ for every $H \in \mathcal{H}$, which is the definition of $(\mathcal{F}, \mathcal{H})$-measurability of $g \circ f$.
[guided]
The proof rests on a single algebraic identity for preimages: $(g \circ f)^{-1} = f^{-1} \circ g^{-1}$, where $\circ$ on the right refers to composition of the set-valued preimage operators. This identity holds for arbitrary maps between sets — it is purely set-theoretic and does not require any measurability structure.
Let $H \in \mathcal{H}$. We compute
\begin{align*}
(g \circ f)^{-1}(H) &= \{x \in X : (g \circ f)(x) \in H\} \\
&= \{x \in X : g(f(x)) \in H\} \\
&= \{x \in X : f(x) \in g^{-1}(H)\} \\
&= f^{-1}\!\bigl(g^{-1}(H)\bigr).
\end{align*}
Now we apply the two measurability hypotheses in sequence:
1. Since $g$ is $(\mathcal{G}, \mathcal{H})$-measurable and $H \in \mathcal{H}$, the definition of measurability gives $g^{-1}(H) \in \mathcal{G}$.
2. Since $f$ is $(\mathcal{F}, \mathcal{G})$-measurable and $g^{-1}(H) \in \mathcal{G}$, the definition of measurability gives $f^{-1}(g^{-1}(H)) \in \mathcal{F}$.
Combining: $(g \circ f)^{-1}(H) = f^{-1}(g^{-1}(H)) \in \mathcal{F}$ for every $H \in \mathcal{H}$, so $g \circ f$ is $(\mathcal{F}, \mathcal{H})$-measurable.
Note that the argument is symmetric in structure but not in content: the order matters. We first "pull back" through $g$ (from $\mathcal{H}$ into $\mathcal{G}$), then through $f$ (from $\mathcal{G}$ into $\mathcal{F}$). Reversing the order would attempt to apply $g^{-1}$ to an $\mathcal{F}$-set, which is meaningless since $g$ maps $Y$ to $Z$, not $X$ to anything.
[/guided]
[/step]