$n$-abelian Groups 
Show that $(xy)^n=x^ny^n$ if $xy=yx$. 

I assume I will need 3 different cases: $n < 0$, $n=0$, and $n > 0$.
For the $n > 0$ case, can I use induction? For the base case I'll show that if $n=$1 then $(xy)^1=x^1y^1$ which will give us xy=xy so the base case is satisfied. Then I'll assume that the statement is true for n+1. Is that on the right track? 
For $n=0$, is it just trivial? that $(xy)^0=x^0y^0$ and when talking about groups $x^0=1$ so we will have $1=$1 which is true. 
For $n < 0$, I was advised to use $(xy)^n=((xy)^{-1})^{-n}$. I'm not exactly sure how to go about this step. 
I don't think I completely understand the part where this only works when $xy=yx$. 
Any suggestions or help would be great! Thanks! 
 A: The answer of Ishfaag is right, but I want to review some points about this problem.
There are a lot of attempts for generalizing the concept of abelian groups and one of them is $n$-abelian groups. A group $G$ is said to be $n$-abelian if $(xy)^n = x^ny^n$ for all $x,y \in G$. It is also easy to see that a group $G$ is $n$-abelian if and only if it is $(1-n)$-abelian. The idea of  $n$-abelian is proposed by Levi in $1944$. As the friends said, $G$ is an abelian group if and only if $2$-abelian. $n$-abelian have been the subject of many investigations, for instance, Alperin, Delizia-Tortora and Baer.
A: As John Habert pointed out the stipulation $xy = yx$ is required since $(xy)^2 = (xy)(xy)$ and you need to be able to commutate the two terms in the middle in order to say this equals $xxyy = x^2y^2$. 
You are pretty much on the right track I believe. I'll make my own humble attempt at a solution too then.


*

*Case 1: $n \gt 0$
Let us induct on $n$. The base case is obvious since $(xy)^1 = xy = x^1y^1$. Suppose the result is true for $n$. That is we assume $(xy)^n = x^ny^n$. Then  $$(xy)^{n+1} = (xy)^n (xy) = (x^ny^n)(xy) = (x^ny^{n-1}y)(yx) = x^n . yyy..yxy$$
Since $xy = yx $, we may commutate the $x$ on the right with preceding $y$'s to equate this expression to;$$x^nxyyyy...y = x^{n+1}y^{n+1}$$
$\implies$ the result holds for $n+1$ and thus for all $n \in \Bbb N$. 


*

*Case 2: $n \lt 0$
As you have done $(xy)^n = ((xy)^{-1})^{-n} = ((yx)^{-1})^{-n} = (x^{-1}y^{-1})^{-n}$ according to the definition of negative exponents, due to commutativity  and since $(yx)^{-1} = x^{-1}y^{-1}$. Now, $(-n) \gt 0$ for which we have proved the result. Therefore, 
$$(xy)^n = (x^{-1}y^{-1})^{-n} = (x^{-1})^{-n}(y^{-1})^{-n} = x^ny^n$$
This is again true due to the definition, $x^{-n} = (x^{-1})^{n}$


*

*Case 3: $n = 0$
This is trivially true as you have mentioned. 
I hope you understand how essential the condition $xy = yx$ is in this context. Which I believe was the only intention behind this exercise. Hope I helped.
A: It's simpler if you use two proofs by induction.
Lemma. If $xy=yx$, then $xy^n=y^nx$, for all $n\in\mathbb{N}$.
Proof. The base $n=0$ is obvious: $xy^0=x=y^0x$. Suppose the result holds for $n$; then
\begin{align}
xy^{n+1}&=xy^{n}y &&\text{(by definition)}\\
&=y^nxy &&\text{(by induction hypothesis)}\\
&=y^nyx &&\text{(by hypothesis)}\\
&=y^{n+1}x &&\text{(by definition)}
\end{align}
which ends the proof.
Theorem. If $xy=yx$, then $(xy)^n=x^ny^n$, for all $n\in\mathbb{N}$.
Proof. The base $n=0$ is obvious: $(xy)^0=1=x^0y^0$. Suppose the result holds for $n$; then
\begin{align}
(xy)^{n+1}&=(xy)^n(xy) &&\text{(by definition)}\\
&=(x^ny^n)(xy) &&\text{(induction hypothesis)}\\
&=x^n(xy^n)y \\
&=x^n(xy^n)y &&\text{(by the lemma)}\\
&=(x^nx)(y^ny)\\
&=x^{n+1}y^{n+1}
\end{align}
which ends the proof.
For $n<0$, set $g=x^{-1}$, $h=y^{-1}$ and $m=-n$; then
$$
gh=x^{-1}y^{-1}=(yx)^{-1}=(xy)^{-1}=hg
$$
so the theorem can be applied to $g$ and $h$. Now
$$
(xy)^n=((xy)^{-1})^m=(hg)^m=h^mg^n=y^nx^n.
$$
