Q:

Prove that $x^m$ is a generator of the cyclic group $G$ of order $n$ if and only if $(m,n) = 1$

I want to check my proof of the statement.
First, i'll state the following theorem:
Theorem 1.
Let $o(x)$ be the order of $x \in G$. If $o(x)=n$ and $(m,n) = d$ then $o(x^m) = \frac{n}{d}$.
Also, a corollary of a theorem (Dan Saracino's Abstract Algebra, theorem 4.5) that i won't state here says that:
Corollary 1. Let $\langle x \rangle$ denote a generator of a group. If $G = \langle x \rangle$, then $|G| = o(x)$.
Proof. Let $G = \langle x \rangle$ be a cyclic group of order n. Let's assume that $x^m$ is a generator of $G$, then $G = \langle x^m \rangle$. By theorem 1, we know that $o(x^m) = \frac{n}{(m,n)}$.  And by corollary 1, the order of $G$ must be $o(x^m) = \frac{n}{(m,n)}$. But as we know by hypothesis, the order of $G$ is $n$. Then, $n = \frac{n}{(m,n)}$. Finally, for this equality to make sense, $(m,n) = 1$.
Thanks!

A:

For the other side, start with $(m, n)=1$ (which means there exists $p, q \in \mathbb{Z}$ such that $1=mp+nq$) and assume $G=\langle x \rangle$ for some $x \in G$ such that $o(x)=n$.
Note that $x=x^{mp+nq}=(x^m)^p \cdot (x^{n})^q=(x^{m})^p$.
Then, for any $a\in G$, we have $a=x^t=(x^m)^{tp}$ for some $t \in \mathbb{N}_0$. Consequently, $G=\langle x^m \rangle$.

