Prove that every group of order 4 is abelian.
My solution goes like this:
We consider a group $G=\{e,a_1,a_2,a_3\}$ and a homomorphism from $f:G\longrightarrow \Bbb Z_2\times \Bbb Z_2$ such that $f(e)=(0,0),f(a_1)=(0,1),f(a_2)=(1,0),f(a_3)=(1,1).$ Now, $f$ is a homomorphism indeed as $\forall a,b\in G$, $f(ab)=f(a)+f(b)$ and $f$ is onto and injective due to which it's an isomorphism and hence $G\cong \Bbb Z_2\times \Bbb Z_2 .$ Now, since $ \Bbb Z_2\times \Bbb Z_2 $ is abelian, $G$ is also abelian.
Is the above solution correct? If not, where is it going wrong?
I know there are numerous posts on this topic in this site but I want to verify whether this particular solution can be considered valid or not.
EDIT: Thank you everyone! I finally got the answer that why this solution is not valid as Mariano Suárez-Álvarez along with many others pointed out. The problem is resolved!
Actually, the solution given on the post is wrong solely because $f$ is actually not a homomorphism as pointed out by Mariano Suárez-Álvarez in the comment section. That's because when I try to prove $f$ as a homomorphism, it rather becomes a fake-proof because: