Finding an example of a group with some properties 
Let $(G, \cdot)$ be a non-abelian group with the identity element $e$, knowing that there exists the element $a$, such that $x^2=a,\;\, \forall x \in G-\{ e, a, a^{-1}\}$. Give an example of such a group and find the maximum value for $\lvert G \rvert$.

How should I approach a problem like this? I can't seem to find a meaningful example. The first one I thought about was the Klein group, but that is commutative. And I have no ideea how to find the maximum value for the cardinality of $G$.
 A: I would say an example is $Q_8$ this is the quaternion group.
$Q_8=\{ \pm 1, \pm i,\pm j,\pm k\}$ when the element $a=-1$ in the group meets your demand.
The way multiplication is defined, you get
$\begin{align}
\mathbf i^2 &= \mathbf j^2 = \mathbf k^2 = -1, \\[5mu]
\mathbf{i\,j} &= - \mathbf{j\,i} = \mathbf k, \qquad
\mathbf{j\,k} = - \mathbf{k\,j} = \mathbf i, \qquad
\mathbf{k\,i} = - \mathbf{i\,k} = \mathbf j.
\end{align}$
You can see how the multiplication is defined here https://en.wikipedia.org/wiki/Quaternion
As noted, $a=x^2=(x^{-1})^2=(x^{2})^{-1}=a^{-1}$ so $a$ is of order $2$, while the rest are of order $4$ since $x^4=a^2=aa^{-1}=1$
I'm not exactly sure how you would show this, but maybe Using Lagrange's theorem, maybe we could deduct the maximal group claim.
A: As noted in NedVed's answer, the quaternion group is an example of such a group $G$.
Furthermore any such group has $a$ as the unique element of order $2$ and every other non-trivial element of order $4$.
By a standard theorem in group theory (corollary of Cauchy's theorem about the existence of elements of prime order), since every element of $G$ is of order a power of $2$ we must have the cardinality of $G$ to be either a power of $2$ or infinite.
One way to see that $|G|\leq 8$ is to refer to the classification of groups of order $16$, and in particular the order of elements in each such group, and notice that any group of order $16$ either has more than one elements of order $2$, or it has an element of order $8$. This shows $G$ cannot have a subgroup of order $16$, but another standard result in group theory states that a group of order $p^n$ has subgroups of order $p^m$ for any $m\leq n$, this at least handles the case where $G$ is finite.
I will show another way to prove this without using that classification.
To denote elements of $G$, I will use $e$ for the identity, $a$ for the unique element of order $2$, and $i,j,k$ for arbitrary elements of order $4$.
We proceed with the following lemmas:
Lemma 1: Let $i\in G$ be an element of order $4$, then $i^{-1}=ai=ia$.
In particular $a$ is in the center of $G$ (since $a$ also commutes with itself and with $e$).
Proof: Since $i$ is of order $4$, $i^{-1}=i^{3}=(i^2)i=ai$, similarly $i^{-1}=ia$ $\blacksquare$
Lemma 2: Let $i,j\in G$ be elements of order $4$, then $i,j$ commute (i.e. $ij=ji$) if and only if $i=j$ or $i=j^{-1}$.
Proof: Suppose $i,j$ commute, then $(ij)^2=i^2j^2=a^2=e$, so $ij$ is of order dividing $2$ so either $ij=a$ in which case $i=aj^{-1}=j$ (by Lemma 1), or $ij=e$ in which case $i=j^{-1}$.
The converse direction is trivial $\blacksquare$
Lemma 3: Let $i,j\in G$ be elements of order $4$ that don't commute, then $ij=ji^{-1}$ and $ij$ is also an element of order $4$ that doesn't commute with neither $i$ nor $j$.
Proof: First, by Lemma 1 we have $ij=(j^{-1}i^{-1})^{-1}=aj^{-1}i^{-1}=ji^{-1}$, next, we have $(ij)(ij)=ji^{-1}ij=j^2=a$ hence $ij$ is an element of order $4$.
Finally $(ij)i=ji^{-1}i=j$ while $i(ij)=aj=j^{-1}$, so $ij$ and $i$ don't commute, and a similar calculation shows that $ij$ and $j$ don't commute $\blacksquare$
Lemma 4: Let $i,j,k\in G$ be elements of order $4$ that don't commute (i.e. $ij\neq ji$ and $ik\neq ki$ and $jk \neq kj$), then $ij=k$ or $ij=k^{-1}$.
Proof: By lemma 3 applied twice, we have $(ij)k=ijk=ikj^{-1}=ki^{-1}j^{-1}$
By the above and by lemma 1 applied twice we have $(ij)k=k(i^{-1}j^{-1})=k(aiaj)=k(a^2ij)=k(ij)$.
Therefore $ij$ and $k$ are elements of order $4$ (by lemma 3) and we showed they commute, hence by lemma 2 we have $ij=k$ or $ij=k^{-1}$ $\blacksquare$
(another option is to show that $(ijk)^2=e$ using lemma 3, this gives $ijk=a$ or $ijk=e$, then we can conclude the result in the same way as in the proof of lemma 2)
Now we are ready to prove the theorem:
Theorem: Let $G$ be a group, and suppose $a\in G$ is such that $a$ is the unique element of order $2$ in $G$ and such that every element of $G\setminus\{e,a\}$ is of order 4, then $G$ has at most $8$ elements.
Proof: From lemma 2, we see that the elements of order 4 are divided into pairs of an element and its inverse, and elements from different pairs do not commute.
Let the cardinality of the set of those pairs be $m$, then $|G|=2+2m$ (we have the elements $e$ and $a$ and $2m$ elements of order $4$).
If we had $m\geq 4$, then we could find 3 non-commuting elements $i,j,k\in G$ of order $4$ such that $k\neq ij$ and $k\neq (ij)^{-1}$, but this directly contradicts lemma 4, hence $m\leq 3$ so $|G|\leq 8$ $\blacksquare$.
