Problem
A finite abelian group $G$ has an element $g$ of order $n$, which generates the subgroup $H = \langle g \rangle$. Let $\gamma$ be an element of order $m$ in $G/H$. Show that there exists an element $x \in G$ such that $\lvert x \rvert = \lvert \gamma \rvert = m$.
I copied my instructor's solution, but I missed the last part, and I can't proceed from what's on my notebook.
Suppose that $x_0 \in G$ such that $\overline{x_0} = \gamma$. Since $\lvert \gamma \rvert = m$, $x_0^m \in H = \langle g \rangle$, and we denote $x_0^m = g^k$. Divide $k$ by $m$ to get $k = mq + r$ with $r \in \{0,\dots,m-1\}$. \begin{align} x_0^m &= g^k = g^{mq + r} \\ g^r &= x_0^m g^{-mq} = \left(x_0 g^{-q} \right)^m \end{align} We want to show $r=0$.
Let $x' = x_0 g^{-q}$. Observe that $\overline{\mathstrut x'}=\overline{\mathstrut x_0}=\gamma$ and $m \mid \lvert x' \rvert$ because $$e = x'^{\mathstrut \lvert x' \rvert} = x_0^{\mathstrut \lvert x' \rvert} \underbrace{g^{\mathstrut -q \lvert x' \rvert}}_{\in H}.$$ $$\therefore \lvert (x')^m \rvert = \frac{\lvert x' \rvert}{\gcd(m,\lvert x' \rvert)} = \frac{\lvert x' \rvert}{m}$$
I don't know how to continue with this.