Let G be a group such that $(xy)^2 = (yx)^2$ for all x, y ∈ G. Show that $xy^2 = y^2x$ for all x, y ∈ G. I'm not quite sure if I did this right but I had another solution that made no sense to me: 
This is the solution I do not understand. I did not solve it this way.
$=>(xy)^{-1}(xy)^2(yx)^{-1} = (xy)^{-1}(yx)^2(yx)^{-1}$
$=>(xy)(yx)^{-1} = (xy)^{-1}(yx)$
then somehow we have 
$=> xy^2 = x((x^{-1}y)x)^2$
$=> xy^2 = x(x(yx^{-1}))^2$
$=> xy^2 = (xyx)^{-1}(xyx^{-1})x$
$=> xy^2 = y^2x$
I'm positive that the solution above is wrong I just need confirmation. 
This is my solution:
Since G is a group then for all x,y ∈ G there exists $x^{-1}$ , $y^{-1}$ ∈ G.
$(xy)^2 = (yx)^2$
$y^{-1}x^{-1}xyxy = y^{-1}x^{-1}yxyx$
$xy = y^{-1}x^{-1}yxyx$
$y = x^{-1}y^{-1}x^{-1}yxyx$
Take the left hand side of $xy^2 = y^2x$ and substitute $y = x^{-1}y^{-1}x^{-1}yxyx$
$xy^2 = x(x^{-1}y^{-1}x^{-1}yxyx)^2$
$xy^2 = x(x^{-1}y^{-1}x^{-1}yxyx)(x^{-1}y^{-1}x^{-1}yxyx)$
$xy^2 = xx^{-1}y^{-1}x^{-1}yxyxx^{-1}y^{-1}x^{-1}yxyx$
$xy^2 = y^{-1}x^{-1}yyxyx$
$xy^2 = y^{-1}x^{-1}y^2xyx$
$xyxy^2 = y^2xyx$
$y^{-1}x^{-1}xyxy^2 = y^2xyxx^{-1}y^{-1}$
$xy^2 = y^2x$.

This might be same argument as in previous answer:
$$(x^{-1}\cdot yx)^2=(yx\cdot x^{-1})^2 \,\,\,\, \Rightarrow \,\,\,\, x^{-1}y^2x=y^2.$$
