Let $G$ be a group of order $2n$. Show that $f$ can not be surjective. Let $G$ be a group of order $2n$, $f:G\rightarrow G$ be a mapping such that $f(x)=x^2$.

Show that $f$ can not be surjective.

 A: It is enough to show that the mapping cannot be injective.
We show that there are at least two solutions of $x^2=e$, where $e$ is the identity.
Pair $a$ and $b$, where $a\ne b$, if $ab=e$. Note that for any $a$ there is at most one $b$ paired with $a$, and that if $b$ is paired with $a$, then $a$ is paired with $b$.
Thus an even number of elements of $G$ belong to couples. Since $G$ has even order, it follows that an even number of elements $x$ of $G$ are "single." But $e$ is "single," so there is at least one other "single," meaning at least one additional solution of $x^2=e$. It follows that the function $x^2$ is not injective.
A: Let $x$ be an element of order $2$ then $x^2=e$, since this map is not one to one from $G$ to $G$, it can not be onto.
Note: Such a $x$ exists by Cauchy theorems.
Added: You may want to learn more strong result;
Let $G$ is a finite group of order $n$ and $f:G\mapsto G$ be function with $f(x)=x^k$ then $f$ is a bijection if and only if  $gcd(k,n)=1$.
A: Since $|G|$ is even, one knows that $G$ contains a subgroup $H=\{e,g\}$ consisting of exactly 2 elements. Since $g^2=e$ we must have
$$
f(g)=f(e)=e
$$
so that $f$ is not injective. But then $f$ is not surjective either, because $G$ is finite.

ADDED: 4 answers at the same time!
A: Using Cauchy's theorem, it is possible to show that $f$ maps two elements of $G$ to the identity.  Now apply the fact that, since $|G|$ is finite, $f$ is surjective $\iff$ $f$ is injective.
A: Just to add a silly (repeat, silly) extra answer, proving directly that $f$ cannot be surjective.
Consider an element $x \in G$ of the maximum possible order of the form $2^{k}$. By Cauchy's theorem, $x \ne e$, that is, $k \ge 1$. Then $x$ cannot be in the image of $f$, because if there is $y \in G$ such that $x = f(y) = y^2$, then $y$ has order $2^{k+1}$, because $y^{2^{k+1}} = x^{2^{k}} = e$, while $y^{2^{k}} = x^{2^{k-1}} \ne e$. (Here we have used $x \ne e$, that is, $k \ge 1$.)
