Is it true that if $\phi :G \rightarrow G $ defined by $ \phi(x)=x^{4}$ is a homomorphism, then $G$ is abelian?
By the property of homomorphisms we see that $\forall x,y \in G $ we have
$$\begin{align} \phi(xy) = \phi(x)\phi(y) &\Rightarrow (xy)^4 = x^4 y^4 \\ &\Rightarrow (yx)^3=x^3y^3. \end{align}$$
I couldn't find of a way to get $xy=yx$ from this.
I tried to find a counter-example by considering small non-abelian groups such as $D_3$ and $S_4$ however for those, there were always elements such that $\phi(xy) \neq \phi(x)\phi(y)$
With the dihedral group $D_4$ acting on four elements, the fourth power of any element is the identity. And sending each element to the identity is always a homomorphism, but $D_4$ is not abelian.