In Steve Awodey's book Category Theory, he has some proof that seems wrong to me on page $60$, he mentioned a proposition that
Proposition $3.11.$In the category $Ab$ of abelian groups, there is a canonical isomorphism between the binary coproduct and product,
$$A+B \cong A \times B.$$
And his proof goes as follows,
Proof. To define an arrow $\theta:A+B \to A \times B,$ we need one $A \to A \times B$ (and one $B \to A \times B$), so we need arrows $A \to A$ and $A \to B$ (and $B \to A$ and $B \to B$). For these, we take $1_A : A \to A$ and the zero homomorphism $0_B : A \to B$ (and $0_A:B \to A$ and $1_B : B \to B$). Thus, all together, we get $$\theta = [\langle1_A,0_B\rangle,\langle0_A,1_B\rangle]:A+B \to A \times B.$$ Then given any $(a,b) \in A+B,$ we have $$\theta(a,b) = [\langle1_A,0_B\rangle,\langle0_A,1_B\rangle](a,b) \\ =\langle1_A,0_B\rangle(a)+\langle0_A,1_B\rangle (b) \\ = \langle1_A(a),0_B(a)\rangle+\langle0_A(b),1_B(b)\rangle \\ = (a,0_B) + (0_A,b) \\= (a+0_A,0_B+b)\\ = (a,b) $$
My question is that: where did he exactly use the assumption that the group $A$ and $B$ are abelian. He did not explicitly stated the fact, so I am a little bit suspicious about the proof.
And another thing, he leave the identity $[f,g](a,b) = f(a)+_X g(b)$ (page $60$) as an exercise. I did not get the way to prove it. If anyone has the proof, please share in the post. Thank you.
As I mentioned in the comment, I really don't like Awodey's proof.
If I was proving this, I'd construct the inverse $\varphi: A \times B \rightarrow A + B$ to the morphism $\theta$ that Awodey gave by using the projections $\pi_A: A \times B \rightarrow A$, $\pi_B: A \times B \rightarrow B$ and the inclusions $\iota_A:A \rightarrow A+B$, $\iota_B:B \rightarrow A+B$.
I would define $\varphi = \iota_A \pi_A + \iota_B \pi_B$. (This is where abelian-ness is used. You can't define the addition of group homomorphisms like this unless the groups are commutative.)
You can check for yourself that this is an inverse to $\theta$.
Edited: I've also just realised that this helps with your second question about the exercise, about $[f,g](a,b)$. $(a,b)$ is an element of $A \times B$, but $[f,g]$ is a morphism out of $A + B$. Awodey has implicitly used the fact that they are isomorphic again.
In other words, there's an implied instance of $\varphi$ in the expression: it should be $[f,g] \varphi (a,b)$.