Prove c is an isomorphism iff G is abelian

Let G be any group. Define c:G-->G by c(x)=x^-1 for all x in G. prove that c is an isomorphism iff G is abelian.

Let c be an isomorphism. We want to show G is abelian.

Since c is an isomorphism, c is 1-1, onto, and a homomorphism.

We have c(a)=c(b) implies a=b by 1-1

c(a)=a^-1

c(b)=b^-1

a^-1=b^-1

a^-1a=b^-1a

e=b^-1a

be=bb^-1a

b=a

We have c(x)=y by onto

y=c(x)=x^-1

y=x^-1

yx=x^-1x

yx=e

y^-1yx=y^-1e

x=y^-1 onto

Now c(ab)=c(a)c(b)

c(a)c(b)=a^-1b^-1

Since c(ab)=a^-1b^-1

G must be abelian since (ab)^-1=b^-1a^-1

Now suppose G is abelian. We want to show this implies c is an isomorphism.

Since G is abelian, we know ab=ba

1-1 and onto follow by the same ideas as before

c(a)c(b)

a^-1b^-1

Since c is abelian (ab)^-1=a^-1b^-1

c(a)c(b)=c(ab)

I am really not sure if I did any of those correct