I have no trouble proving the following statement. Let $G$ be a cyclic group of order $n$ and let $k$ be an integer relatively prime to $n$. Prove the map $x \mapsto x^k$ is surjective. It is clear by $<x>=<x^{k}>$ by $\text{gcd}(k,n)=1$.
However, I fail to see why this is also surjective for any finite group of order $n$ though I can see $x^{n}=1$ for any $x$ in the group. Where is the surjectivity coming from in this context?
Let $y \in G$, then $y = x^m$ for some $m \in \{1,2,..,n\}$. Write $m = kp + q$. Thus: $y = x^m = x^{kp+q} = (x^k)^p\cdot x^q$. This shows $x^q \in G = <x^k>$ with$0 \leq q < k$. Thus $x^q = e$, and $q = 0$, and $y = x^m = (x^p)^k = f(x^p)$. So $f$ is onto.