# Determine if $\phi (g)=g^{-1}$ is a homomorphism.

Let $G$ be any group, and let $\phi:G\to G$ be given by $\phi(g)=g^{-1}$. Is $\phi$ a homomorphism?

I just start by seeing if the homomorphism property $\phi(ab)=\phi(a)\phi(b)$ is satisfied:

$\phi(g_1g_2)=(g_1g_2)^{-1}=g_2^{-1}g_1^{-1}=\phi(g_2g_1)=\phi(g_2)\phi(g_1)$

(EDIT: Added the last part, $=\phi(g_2)\phi(g_1)$)

So... $\phi$ is a homomorphism, but only if G is an abelian group? I'm probably doing something wrong here.

In general, $\phi$ is not a homomorphism. We only need to consider a non-abelian group with $a,b$ such that $ab\neq ba$.
Then if $\phi$ is a homomorphism we have $\phi(ab)=b^{-1}a^{-1}=a^{-1}b^{-1}$
or $ab=ba$, a contradiction.
You are exactly right, except you should have written: $$\cdots = g_2^{-1}g_1^{-1} = \phi(g_2)\phi(g_1)$$ In general $\phi(g) = g^{-1}$ defines an isomorphism from $G$ to its opposite group $G^\text{op}$, which has the same underlying set as $G$, but his operation is reversed''. Ie, if the operation of $G$ is $\cdot$ and the operation of $G^{\text{op}}$ is $*$, then $b*a := a\cdot b$.
Indeed as you observed $\phi$ is only an automorphism if $G$ is abelian, which is precisely when $G^\text{op} = G$.