Proof (preimage of transversal submanifold)

Take any $x\in f\inv(Z)$. There exists an open neighbourhood $U\subseteq X$ of $x$ and a smooth map $g: U\to \R^q$ where $q = \op{codim}_Y Z$ such that $0\in \R^q$ is a regular value of $g$ and $Z = g\inv(0)$. (TODO)

Note $f\inv(Z) \cap U = (g \circ f)\inv(0)$, so by the preimage theorem, it suffices to show $0$ is a regular value of $g \circ f$. By transversality, $$ \begin{align*} T_{f(x)} Y ={}& \im \d f_x + T_{f(x)} Z \\ ={}& \im \d f_x + \ker \d g_{f(x)} \end{align*} $$ as we have shown here, so applying $\d g_{f(x)}$ to both sides and noting $0$ is a regular value of $g$, $$ \begin{align*} \R^q = \d g_{f(x)}(\im \d f_x) = \im(\d g_{f(x)} \circ \d f_x) = \im \d(g \circ f)_x, \end{align*} $$ as required.