This question is reasonably hard, but important. A very clear and explicit answer is given in:
Flannery, D. L.; O'Brien, E. A.
"Linear groups of small degree over finite fields."
Internat. J. Algebra Comput. 15 (2005), no. 3,
MR2151423
doi:10.1142/S0218196705002426
This has applications to primitive, solvable, linear groups of prime-squared degree and many other problems where an explicit knowledge of the subgroups of $\mathrm{GL}(2,q)$ is needed. This takes a fairly different approach from Dickson which is based on the geometric actions of $\mathrm{PSL}(2,\mathbb{C})$, and instead uses a more module-theoretic approach, some of which goes back Suprunenko especially as carried on by Short. The classes of $\mathrm{PGL}(2,q)$ split in somewhat unusual and hard to control ways (I found the dihedrals to be a nightmare), but subgroups of $\mathrm{GL}(2,q)$, like subgroups of $\mathrm{Sym}(n)$, can be classified by their action on the natural space.
This gives a simple formula for the number of conjugacy classes of abelian groups:
- $(a(q−1)−b(q−1))/2 + b(q−1)$ classes of diagonal subgroups, $a$,$b$ defined below
- $\tau(q^2−1) − \tau(q−1)$ classes of irreducible, but not absolutely irreducible abelian subgroups (Singer)
- $\tau(q−1) \log_p q$ classes of indecomposable, but reducible abelian groups (central*unipotent)
Here $a$,$b$ are (weakly) multiplicative functions with values on prime powers:
- $a(p^e) = (p^{e+2} + p^{e+1} + 1 + 2e − 3p − 2ep) / (p−1)^2$
- $b(2^e) = 2e^2−2e+3$
- $b(p^e) = (e+1)^2$, $p$ odd
These functions are fairly natural: $a(n)$ counts the number of subgroups of $\mathbb{Z}/n\mathbb{Z} \times \mathbb{Z}/n\mathbb{Z}$, and $b(n)$ counts the number of those subgroups left invariant by a coordinate swap.
I am still working through the details of the non-abelian groups, but do not foresee any problems. The paper handles $\mathrm{GL}(2,q)$ for $q=p^e$, $p \geq 5$, but for the most part I only need $e=1$, and the omissions in the paper are not too serious even for $p=2,3$.
A reducible subgroup of $\mathrm{GL}(2,q)$ must be abelian, and so the next case are the non-abelian imprimitive groups, all of which must be monomial and so have a clear list of representatives. The primitive linear groups seem to be messier in the details, but as one can more clearly distinguish the "$Z$" from the "$\mathrm{PGL}$" part, Dickson's method appears to just work.
As pointed out in comments and at this question, this answer is not entirely correct because real/quaternionic does not always give a $\mathbb{Z}/2$ grading. Nonetheless in practice this answer seems to be "mostly right." I'm going to leave it up unmodified because changing it would confuse the comments and other answers too much. Sorry for the mistake!
If $G$ has a quaternionic representation and $G$ has no complex representations (i.e. reps whose character is complex) then for certain nontrivial central elements the square root function is $\sum_\chi \chi(1)$ which is clearly the maximum possible value and clearly larger than the value on the identity.
The key idea in the proof is the fact that $Z(G)^*$ (the group of characters of the center of $G$) is the universal grading group for the category of $G$ representations.
Let me unpack that a little bit. To every irrep of $G$ you can assign it's "central character", that is an element of $Z(G)^*$. This assignment is multiplicative in the sense if $U$ is a subrep of $V \otimes W$ then the central character of $U$ is the product of the central characters of $V$ and $W$ (this is just because central elements act by scalars). In other words, $\operatorname{Rep}(G)$ is graded by $Z(G)^*$. The claim is that an $H$-grading of $\operatorname{Rep}(G)$ is the same thing as a map $Z(G)^* \to H$.
Why is this true? I'm just going to sketch the proof, in particular I'm just going to talk about the case where $Z(G)$ is trivial, but I'll indicate how the general case works. Since the center is trivial you can find a faithful representation $V$. But then let's look at a really high tensor power of $V$ and ask how it breaks up. We can compute that using character theory. Since the rep is faithful and there's no center, the character of a high tensor power of $V$ is dominated by the value on $1$. Hence any high tensor power of $V$ contains all other irreps. In particular, the $n$-th and $(n+1)$-th powers contain the same irreps and this tells you that the grading group is trivial. In general you want to argue that the contribution of the center dominates the values of inner products (but you need to be a bit careful about non-faithful representations).
The "universal grading group" is used by Gelaki and Nikshych to define the upper central series of an arbitrary fusion category and thereby define nilpotent fusion categories.
Ok, how is this relevant to anything? Well, if you have a group with a quaternionic representation but no complex representations, then the Frobenius-Schur indicator gives a $\pm 1$ grading of $Rep(G)$, namely put the real reps in grade $1$, and the quaternionic ones in grade $-1$. Hence the Frobenius-Schur indicator $s(\chi)$ must be given by the central character $\chi(z)/\chi(1)$ for some central element $z$. Clearly these central elements maximize the square root function.
Best Answer
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$.