In Aluffi's book "Algebra. Chapter 0" a group homomorphism is defined the following way. For two sets $G$ and $H$ with operations $m_G$ and $m_H$ firstly a set-function $\varphi\colon G\to H$ is considered. Then the author states:
Note that the set-function $\varphi\colon G\to H$ determines a function $$ (\varphi\times\varphi)\colon G\times G\to H\times H: $$ we could invoke the universal property of products to obtain this function.
He then defines $\varphi\times\varphi$ explicitly as $$ (\varphi\times\varphi)(a,b)=(\varphi(a),\varphi(b)) $$ and requires a certain diagram to commute.
But somehow I fail to understand how exactly $\varphi\times\varphi$ is a product in this case. According to the universal property of products it is a final object in category $\mathsf{C}_{A,B}$ ($\mathsf{C}=\mathsf{Set}$, and $A=B=H$, I assume). So I took $H\times H$ with two morphisms $\tau_1,\tau_2\colon H\times H\to H$ (natural projections) and tried to construct a morphism from another alike object $G\times G$ (which also has natural projections $\pi_1,\pi_2)$, namely $\sigma\colon G\times G\to H\times H$. What I got indeed strongly resembled a product, not $\varphi\times\varphi$ though, but rather $\varphi\pi_1\times\varphi\pi_2$. The diagram I got commutes if $\varphi\pi_1=\tau_1\sigma$ and $\varphi\pi_2=\tau_2\sigma$.
In general, according to the definition, $f_A\times f_B$, $f_A$ and $f_B$ all have the same domain (for example, $f_A\times f_B\colon Z\to A\times B$, $f_A\colon Z\to A$, $f_B\colon Z\to B$), which makes me even more confused.
What do I miss here?