This is an exercise from Algebra of Programming which I'm reading for self-study. Below, $T$ is the initial algebra of $F$.
What I've tried:
I can construct $h \circ F (\pi_2) : F(A \times B) \rightarrow B$. Then we take the product $\langle g, h \circ F(\pi_2) \rangle : F(A \times B) \rightarrow A \times B$. We can then take the catamorphism $cata(\langle g, h \circ F(\pi_2) \rangle) : T \rightarrow A\times B$ and need to show that $f = \pi_1 \circ cata(\langle g, h \circ F(\pi_2) \rangle)$.
I've tried using the fact that the diagram above commutes to get the equality above, to no avail. Any suggestions?