Assume $(G,\times)$ is a group and for $a,b \in G$: $ab=ba$, $\text{ord}(a)=n$, $\text{ord} (b)=m$ Assume $(G,\times)$ is a group and for $a,b \in G$: $ab=ba$, $\text{ord}(a)=n$, $\text{ord}
(b)=m$

*

*Show that if $\gcd(m,n)=1$ then $G$ has an element of order $nm$.

*If $m,n$ are arbitrary,then $G$ has an element of order $\text{lcm}(m,n)$

Since $G$ is not cyclic I don't have any idea how to start, any help is appreciated.

Lemma: Assume $(G,\times)$ is a group and $a,b \in G$, Moreover $ab=ba$.
let $\text{ord}(a)=n$ and $\text{ord}(b)=m$,then $\text{ord}(ab)\mid \text{lcm}(n,m)$.
$\text{lcm}(n,m)=ns$ and $\text{lcm}(n,m)=mr$ for some $r,s \in \mathbb Z^+$,then:
$$(ab)^{\text{lcm}(n,m)}$$ Since $ab=ba$ ,hence $$=a^{\text{lcm}(n,m)}b^{\text{lcm}(n,m)}$$
$$=a^{ns}b^{mr}=(a^n)^s(b^m)^r$$
$$=e^se^r=e$$
Follows $\text{ord}(ab)\mid \text{lcm}(n,m)$.


*

*Since $\text{ord}(ab) \mid \text{lcm}(n,m)=\frac{nm}{\text{gcd}(n,m)}$,By the assumption $\text{gcd}(n,m)=1$ So $\text{ord}(ab) \mid nm$

*If $\text{ord}(ab)
 \mid \text{lcm}(n,m)$ then there is $g \in G$ such that $g^{\text{lcm}(n,m)}=e$
 A: Okay. Let's argue that that $lcm(n,m)|\mathrm{ord}(ab)$ from which you'd get the result by simply adding your lemma.
Well, if $(ab)^k=1$, then by commutativity, we have $a^k=b^{-k}$. However, $\mathrm{ord}(a^k)=\frac{lcm(k,n)}{k}$ and $\mathrm{ord}(b^{-k})=\frac{lcm(k, \mathrm{ord}(b^{-1}))}{k}=\frac{lcm(k,m)}{k}$, so we get that
$$
lcm(k,n)=lcm(k,m)
$$
which, in particular, implies that $m$ divides $lcm(k,n)$. Since $n$ and $m$ are co-prime, this implies that $m|k$. This implies that $\mathrm{ord}(b^k)=1$ and similarly, that $\mathrm{ord}(a^k)=1$. All in all, we get that $lcm(n,m)|\mathrm{ord}(ab)$, which is what we wanted.
A: I use $|a|$ to denote the order of $a$. Take $G, a, b$ as in your question.
Lets first prove:
Claim 1: If $|a| = n$, $|b| = m$, and $n,m$ are coprime, then $|ab| = nm$.
It is clear that $(ab)^{nm} = e$, because $G$ is abelian. Hence, we know that $|ab| \mid nm$.
To show the converse, suppose that $(ab)^k = e$. Then $a^k b^k = e$, so $a^k = b^{-k}$.
Taking both sides to the $m$-th power, we have $a^{mk} = b^{-mk} = (b^m)^{-k} = e$. So $|a| = n$ must divide $mk$. Since $n, m$ are coprime, we must have $n \mid k$.
By a symmetrical argument, we have $m \mid k$. So $nm \mid k$. In particular, $nm \mid |ab|$.
Both these steps imply that $|ab| = nm$. This proves the claim.
From the claim, we see that if $G$ contains two elements $a,b$ with coprime orders $n$ and $m$, we can construct an element with order $nm$; one possible construction would be $ab$.
Now, suppose that $n,m$ are not coprime. We can actually obtain a more 'basic' form of $a$ and $b$. The idea is the fact that if $a$ is an element of order $pq$, then $a^p$ has order $q$. So we can find elements with lower order. The goal is then to start with $a,b$, construct elements $a', b'$ with coprime order, and then take the product $a'b'$.
Let $d = \operatorname{gcd}(n,m)$, and write $n = dN$ and $m = dM$. Then we have that $N,M$ are coprime.
Suppose for simplicity that that $\operatorname{gcd}(M, d) = 1$. Then we can do:
We have
$$
|a| = n = dN, \quad
|b^d| = \frac{m}{d} = M $$
and by the first claim, $(a b^d)$ is an element of order $(dN)M = \operatorname{lcm}(n,m)$.
Now, suppose that neither $\operatorname{gcd}(N,d) = 1$ or $\operatorname{gcd}(M, d) = 1$. This case is a lot harder to describe but the idea is very easy once you understand it.
First, you need to split the gcd $d = d_1 d_2$, such that $\frac{m}{d_1}$ is coprime to $\frac{n}{d_2}$. Let me illustrate this with example. Suppose $n = 2^5 3^2 5^1$ and $m = 3^1 5^2 7^5$. Then the gcd $d = 3^1 5^1$. We can write $d_1 =3, d_2 = 5$, and have $n/d_2 = 2^5 3^2$ is coprime to $m / d_1 = 5^2 y^5$.
With that done, we have
$$
|a^{d_2}| = \frac{n}{d_2}, \quad
|b^{d_1}| = \frac{m}{d_1}, \quad
$$
and
$$
|a^{d_2} b^{d_1}| = \frac{n}{d_2} \cdot \frac{m}{d_1} = \frac{NdMd}{d} = NMd = \operatorname{lcm}(n, m)
$$
A: For the first question, this trick can help you : if $(ab)^k=a^kb^k=1$ therefore $a^k = b^{-k}$ so $a^{mk}=b^{-mk}=1$ so $n \mid mk$ and since $\gcd(m,n)=1$ we have $n \mid k$ and $m \mid k$ (by symmetry) so $k= \alpha n= \beta m$ so using the same argument we have $nm \mid k$.
For the second one, remember that $\text{lcm}(m,n)=\frac{mn}{\gcd(m,n)}$ so if $m'=\frac{m}{pgcd(m,n)}$ and $n'=\frac{n}{pgcd(m,n)}$ we have
$$
m'n'=\text{lcm}(m,n) \text{ and } \gcd(m',n')=1,
$$
we get the result using $(1)$.
