Proof involving group homomorphisms The question is as follows:
Let $G_1$ and $G_2$ be groups. Define $\pi_1 : G_1 \times G_2 \rightarrow G_1$ by $\pi_1((a_1,a_2))=a_1.$ Define $\pi_2 : G_1 \times G_2 \rightarrow G_2$ by $\pi_2((a_1,a_2))=a_2.$
Let $G$ be any group, and let $\phi : G \rightarrow G_1 \times G_2$ be a function. Show that $\phi$ is a group homomorphism if and only if $\pi_1\circ \phi$ and $\pi_2\circ \phi$ are both group homomorphisms.
Going forward is easy, but I'm not sure how to do the backwards direction (proving that if $\pi_1\circ \phi$ and $\pi_2\circ \phi$ are both group homomorphisms, then $\phi$ is a group homomorphism.)
 A: It's also easy
$$\varphi(gg')=((\pi_1\circ\varphi)(gg'),(\pi_2\circ\varphi)(gg'))={((\pi_1\circ\varphi)(g)\cdot(\pi_1\circ\varphi)(g')),(\pi_2\circ\varphi)(g)\cdot(\pi_2\circ\varphi)(g')))}=((\pi_1\circ\varphi)(g),(\pi_2\circ\varphi)(g))\cdot((\pi_1\circ\varphi)(g'),(\pi_2\circ\varphi)(g'))=\varphi(g)\varphi(g')$$
A: Look at it this way: $\phi: G \to G_1\times G_2$ takes an element of $G$ and returns a pair: one elment from $G_1$, and one element from $G_2$, i.e. $\phi(g)=(g_1,g_2)$.
Can you manipulate this expression to get equations of the form $g_1=?$, $g_2=?$  The goal is to express $\phi$ entirely in terms of $\pi_1\circ\phi$ and $\pi_2\circ\phi$, which will allow you to explicitly calculate $\phi(gh)$ and $\phi(g)\phi(h)$.
As a side note, I wish that it were not so common to post questions without context.  Math is a very personal thing, and it's almost impossible to give good answers when you don't know where somebody is coming from, what they know, why they're asking a question, or what they hope to get out of it.  I'm not saying that every question should come with an autobiography, but a single sentence like "I am working through Dummit and Foote independently," or "I'm stuck on my homework," or even "I found this fun problem," really makes for a healthier interaction in my opinion.
A: Let $ \phi(g) = (g_1, g_2)$ for each $g \in G$. ,and consider $x, y$ in $G$. We need to show: $\phi(xy) = \phi(x) \phi(y)$. 
Put $\phi(x) = (x_1, y_1)$, and $\phi(y) = (x_2, y_2)$. Then $\phi(x) \phi(y) = (x_1x_2, y_1y_2)$.
Next we compute $\phi(xy)$. Let's put $\phi(xy) = (a,b)$. 
Then $$\pi_1(\phi(xy)) = a,\  \ and\ \ \pi_2(\phi(x*y)) = b$$.
But$$\pi_1(\phi(xy)) = \pi_1(\phi (x))\pi_1(\phi(y)) \implies a = x_1x_2$$, and similarly $$\pi_2(\phi(xy)) = \pi_2(\phi(x))\pi_2(\phi(y)) \implies b = y_1y_2$$. 
So $(a,b) = (x_1x_2, y_1y_2) \implies \phi(xy) = \phi(x)\phi(y) \implies \phi$ is a homomorphism. 
