If $G$ is of order $n$ and $k$ is prime to $n$ then $g(x)=x^k$ is one-to-one 
Let $G$ be a group of order $n$ and let $k$ be prime to $n$, show that $g(x) = x^k$ is one-to-one.

I started trying to prove this, and said:

If $g(x) = g(y)$ for some $x,y \in G$ then $x^k = y^k$. Also, since $n,k$ are prime we have that there are $a,b$ such that $an + bk = 1$. Also, we know that $x^n = y^n = 1$.

But I got stuck there. Somehow I need to use $an+bk = 1$ for some $a,b$ to come to the conclusion that $x=y$, no luck

Note that the function $m\mapsto x^m$ (for any fixed $x$) is periodic, with period dividing $n$; thus what really matters is the value of $m$ modulo $n$. Since $k$ as an inverse modulo $n$, you can then show that $g$ has an inverse defined by $x\mapsto x^b$, thus $g$ must be injective (and even bijective).
More explicitely, you have simply
$$x=x^{an+bk}=x^{an}x^{bk}=(x^k)^b=(y^k)^b=y^{bk}=y^{an+bk}=y.$$
