Prove that a finite group $G$ is nilpotent if and only if whenever $a, b \in G$ with $gcd(o(a), o(b)) = 1$, then $ab = ba$.
I know that a finite group G is nilpotent iff it is a direct product of its sylow subgroups.
$(\implies)$ Let G be nilpotent. So, it is a direct product of its sylow subgroups.
$\therefore G=P_{1}\times P_{2}\times \ldots \times P_{k}$ i.e. $G=P_{1}P_{2}\ldots P_{k}$ where each $P_{i}\lhd G \;\forall\,i\in \{1,2,\ldots,k\}$, and $(P_{1}P_{2} \ldots P_{i})\cap P_{i+1}=\{e\} \;\forall\,i\in \{1,2,\ldots,k\}$.
Consider $a,b \in G$ such that $gcd(o(a),o(b))=1$
Case 1: If $a=e \;\; or \;\; b=e$
There is nothing to prove in this case
Case 2: If $a\neq e\neq b$
If $a,b\in P_{i}, \; sylow\;p_{i}-subgroup$ for some $i$, then $gcd(o(a),o(b))\geq p_{i}>1$. Hence, a contradiction.
$\therefore a\in P_{i}, b\in P_{j},\; i\neq j$
Also, $P_{i}\cap P_{j} = \{e\}$
So, $aba^{-1}b^{-1}\in P_{i}\cap P_{j} $. Hence, $ab=ba$
$(\impliedby)$ Here if I prove that each of the sylow subgroups of G is normal in G, and I already have trivial intersection for each sylow subgroup of distinct primes. So, I would have G as the direct product of sylow subgroups which would imply G is nilpotent.
I am not able to think how to prove the normality part. Please give some hints.
Also, please check the forward implication.
Thanks!