Let $G$ be a finite group such that the only automorphisms of $G$ are the identity automorphism and the map $f\colon G \to G$ defined by $f(x) = x^7$. Prove that $|G|$ is a power of $2$.
Any help and ideea on how to write a complete proof for this problem is welcomed.
My attempt:
$ \textbf{Lemma A.2.} $A finite abelian group with an odd prime factor or multiple nontrivial factors has many automorphisms.” If $G$ is a finite abelian group that is not a cyclic 2‐power group (i.e., if $G$ either has an odd prime factor or is a product of two or more nontrivial cyclic factors), then $\mathrm{Aut}(G)$ has more than 2 elements.
Case 1: $G$ has an odd prime factor $p$. If $p$ divides $|G|,$ the structure theorem guarantees a factor $\mathbb{Z}_{p^k}$ in $G.$ Then $\mathrm{Aut}(\mathbb{Z}_{p^k}) \cong (\mathbb{Z}_{p^k})^\times$ has order $\varphi(p^k)=p^k - p^{\,k-1},$ which exceeds 2 for $p\ge3$ or $k>1.$ Combining further factors typically increases $\mathrm{Aut}(G)$, so we cannot have exactly 2 automorphisms.
Case 2: $G$ is a product of two or more nontrivial factors.} Suppose $G=G_1 \times G_2$ with $|G_1|,|G_2|>1.$ Then there are “factor‐swapping” or “factor‐preserving” automorphisms, easily pushing the size of $\mathrm{Aut}(G)$ above 2.
Therefore, only a single cyclic $2$-power group $\mathbb{Z}_{2^n}$ can have possibly very few automorphisms. Indeed, $\mathrm{Aut}(\mathbb{Z}_{2^n}) \cong (\mathbb{Z}_{2^n})^\times$ has size $2^{n-1}$ (for $n\ge2$), which can be 2 only if $n=2$
Since $f\colon G\to G$ is an automorphism, it is bijective and homomorphic, so $(xy)^7 = x^7 y^7$ for all $x,y\in G.$ By Lemma A.1 (with $n=7$), this implies $xy=yx,$ so $G$ is abelian. Next, $f$ is injective, so $x^7=e$ has only the trivial solution $x=e.$ Thus there is no element of order $7,$ which means $7\nmid|G|.$
By the structure theorem for finite abelian groups, $ G \cong \mathbb{Z}_{p_1^{k_1}} \times \dots \times \mathbb{Z}_{p_r^{k_r}}, $ and we cannot have $p_i=7.$ Moreover, $G$ has exactly 2 automorphisms. By Lemma A.2, any odd prime factor or multiple factors would yield more than 2 automorphisms. Thus $G$ must be a single cyclic $2$‐power group, $ G \cong \mathbb{Z}_{2^n}. $ The group $\mathrm{Aut}(\mathbb{Z}_{2^n}) \cong (\mathbb{Z}_{2^n})^\times$ has size $2^{\,n-1},$ which equals 2 only if $n=2.$ Hence $G\cong \mathbb{Z}_{4},$ and $|G|=4=2^2.$ In fact, $\mathbb{Z}_4$ has precisely two automorphisms (the identity and $x\mapsto x^3\equiv x^7\!\bmod4$). Therefore $|G|$ is indeed a power of 2, and specifically 4.
$ \boxed{|G| = 4,\text{ so it is a power of 2.}} $
$ \textit{Remark.} $ The problem statement only asks to show $|G|$ is a power of 2, but the tighter condition “exactly 2 automorphisms” forces $G\cong \mathbb{Z}_4.$