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

Since $G$ is finite, you only have to show injectivity. So let $x \in G$ with $x^k=1$. Then the order of $x$ is a divisor of $k$. But we also know, that the order of $x$ is a divisor of $n$. Hence the order of $x$ is a common divisor of $k$ and $n$, hence equal to $1$.
