If $A$ and $B$ are groups then prove that $A\times B\cong B\times A$
Yes, the idea is good.
You take a function $f:A\times B\to B\times A$, $(a,b)\mapsto (b,a)$.
Then you proof that this defines a homomorphism, as you have done it.
Now we need to check if it is bijective. The easiest way is to give the inverse function $f^{-1}$. What should this function be?
The existence of an inverse function implies the bijection.
As @Cornman answered you done, just prove 1-1, by showing inverse function is well defined and is homomorphism too. Or show it is onto and has kernel $\{0\}$.
As @CliveNewstead commented, there is no difference between $+$ and $.$ that both shows binary operation. I think you confused by ring! In rings they are two differents binary operations that homomorphisms must satisfy both relation you wrote, and no one implies the other.
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!