For every element $g$ in a group $G$ of order $23$, there is $h\in G$ such that $g=h^2$. 
For every element $g$ in a group $G$ of order $23$, prove that there is $h\in G$ such that $g=h^2$.

I am not sure how to prove this. I think that, since $G$ has prime order is isomorphic to a cyclic group and therefore abelian. I can use that property to prove that $g=h^2$ but i am not sure how. Any help will be appreciated.
 A: Hint: What is $g^{24}{}{}{}$?
A: I shall prove a general result.  First, we say that an element $g$ of a group $G$ is a square if $g=h^2$ has a solution $h\in G$.

Proposition.  For a finite group $G$, every element of $G$ is a square if and only if $|G|$ is odd.

Let $n:=|G|$.  Write $e$ for the identity of $G$.  Recall that $g^n=e$ for all $g\in G$.
If $n$ is odd, then for every element $g\in G$, $$g=g\cdot e=g\cdot g^n=g^{n+1}=g^{2\left(\frac{n+1}{2}\right)}\,.$$  Thus, $h:=g^{\frac{n+1}{2}}$ is a solution to $h^2=g$.
Conversely, suppose that $n$ is even.  Then, let $g\in G$ be an element of $G$ such that the order $t$ of $g$ in $G$ is maximally even (that is, if $t=2^ks$ where $k,s\in\mathbb{Z}_{\geq 0}$ with $s$ odd, then no other element $g'$ of $G$ is of order divisible by $2^{k+1}$).  We know $k\geq 1$ due to Cauchy's Theorem.  If $g=h^2$ for some $h\in G$, then $h$ has order $2t$, which contradicts the choice of $g$.  Therefore, $g$ is not a square.
A: Given $g \in G$, there is no problem in determining $g^2$. I suppose you meant the following: given $g \in G$, determine $h$ such that $g=h^2$.
Every group of prime order is cyclic. Assume $|G|=p$, $p>2$. If $G=\langle a \rangle$, then each $g \in G$ is uniquely of the form $a^k$, with $k \in \{1,2,3,\ldots,p\}$. Now
$$ g = \begin{cases} \big(a^{k/2}\big)^2 & \:\mbox{if}\: k \:\text{is even}; \\ \big(a^{(k+p)/2}\big)^2 & \:\mbox{if}\: k \:\text{is odd}. \end{cases} $$
Thus, corresponding to each $g \in G$, there exists $h \in G$ satisfying $h^2=g$.
The case of $|G|=2$ is simple. In this case, $G=\{e,a\}$, with $a^2=e=e^2$. Thus, there is no $h \in G$ satisfying $h^2=a$. $\blacksquare$
A: In general the following holds.

Let $G$ be a group of order $n$ and let $k$ be a positive integer. Then $gcd(k,n)=1$ if and only if the map $f:G \to G$ given by $f(a)=a^k$ is a bijection.

Proof Let $a^k=b^k$. Since $gcd(k,n)=1$ we can find by Bézout's Theorem integers $x$ and $y$ such that $kx+ny=1$, so $a=a^1=a^{kx+ny}=a^{kx}.a^{ny}=(a^{k})^x=b^{kx}=b^{kx}.b^{ny}=b^{kx+ny}=b$. Here we used that for any $g \in G$, $g^n=1$. Hence the map is injective and since $G$ is finite it is surjective.
Now assume $gcd(k,n)\neq 1$. Then we can find a prime $p$ with $p \mid k$ and $p \mid n$. By Cauchy's Theorem there is an $a \in G$ with order$(a)=p$. Then $a^k=a^{p \cdot \frac{k}{p}}=1^\frac{k}{p}=1$. Since $f$ is injective this yields $a=1$, a contradiction.
