TITLE: If $A$ and $B$ are groups then prove that $A\times B\cong B\times A$
QUESTION [5 upvotes]: My approach
If $f(a,b)$ where $a\in A$ and $b\in B$ be the transformation from $A\times B$ to $B\times A$ then $f(a,b)=(b, a)$. I proved homorphism like this 
$f((a, b) +(a', b'))=f((a+a',b+b'))=(b+b',a+a')$ .
$f(a,b)+f(a',b')=(b+b',a+a')$ . 
Is this correct or should I prove that 
$f((a, b). (a', b'))=f(a,b).f(a',b')$ . How do I prove onto and one one aren't those very trivial and how do I write the proof?

REPLY [2 votes]: Your work is correct.
To prove injectiveness, there are two things you could do:

Set theoretic way. If $f(a,b) = f(a',b')$, is $(a,b) = (a',b')$?
Group theoretic way. Calculate the kernel, i.e. find all $(a,b)$ such that $f(a,b) = (e_B,e_A)$, where $e$'s are the corresponding units of $A$ and $B$. If $\ker f = \{(e_A,e_B)\}$, then $f$ is injective.

To prove surjectiveness, do it as usual. For all $(b',a')\in B\times A$, is there some $(a,b)\in A\times B$ such that $f(a,b) = (b',a')$?
Or you could do it in one go if you can find $f^{-1}$. What could it be? Just a side note, you don't have to prove that $f^{-1}$ is a homomorphism if you know that $f$ is. Inverse of a group homomorphism is always homomorphism. It's a good exercise, try it!