TITLE: How many square roots can a non-identity element in a group have?
QUESTION [53 upvotes]: Let $G$ be a finite group. Let $r_2\colon G \to \mathbb{N}$ be the square-root counting function, assigning to each $g\in G$ the number of $x\in G$ with $x^2=g$. Perhaps surprisingly, $r_2$ does not necessarily attain its maximum at the identity for general groups, see Square roots of elements in a finite group and representation theory.
I'm interested in whether $r_2(g)$ can attain a value above $0.999|G|$ for some non-identity element $g\in G$.
Update: Thanks to everybody who participated in the discussion. The lemma proved here influenced greatly the statement of Theorem 4.2 in https://arxiv.org/pdf/2204.09666.pdf . Proposition 3.12 in this same paper is essentially the answer posted by GH from MO.

REPLY [21 votes]: Here is a streamlined and simplified version of the posts by Saúl Rodríguez Martín and Emil Jeřábek.
Theorem. Assume that $G$ is a finite group, and $r_2(g)>(3/4)|G|$ holds for some $g\in G$. Then $G$ is an elementary abelian $2$-group, and $g$ is the identity element.
Proof. Fix any element $y\in G$, and consider the sets
$$S=\{x\in G: x^2=g\},\qquad T=\{x\in S:xy\in S\}.$$
By the union bound,
$$|G\setminus T|\,\leq\, 2|G\setminus S|<|G|/2,$$
hence $|T|>|G|/2$. For any $x\in T$, we have $(xy)^2=x^2$,
which implies that
$$xyx^{-1}=(xy)x^{-1}=(xy)^{-1}x=y^{-1}.$$
So $\{x\in G:xyx^{-1}=y^{-1}\}$ contains more than half of the elements of $G$, whence it contains all elements of $G$. In particular, $y=y^{-1}$, which shows that $G$ is an elementary abelian $2$-group. Moreover, $g$ is the identity element, since the identity element is the only square in $G$.