Union of subgroups of $G$ when $G$ is cyclic "Let $G$ be a cyclic non-trivial group (infinite or not) and $T$ be the union of all proper subgroups of $G$. Prove that either $T$ is empty or it is a subgroup of $G$ if and only if the order of $G$ is a prime power"
I'm guessing I have to take seperately whether $G$ is finite or not. If finite I'm trying to use Lagrange theorem, but I dont really know where to start... So to summarize, I have to prove that:
$$T= \emptyset  ~~\text{ or }~~T < G~⟺~o(G)=p^n$$
where $p$ is a prime number and $n$ is any non-negative integer.
 A: Lemma. A group $G$ is a union of proper subgroups if and only if $G$ is not cyclic.
Proof. If $G$ is not cyclic, then $\cup_{g\in G}\langle g\rangle = G$ expresses $G$ as a union of proper subgroups. If $G$ is cyclic and $G=\cup_{i\in I} H_i$ with $H_i$ a subgroup of $G$, then let $g\in G$ be a generator of $G$. Then $g\in \cup_{i\in I} H_i$, so there exists $i\in I$ with $g\in H_i$. Since $H_i$ is a subgroup, we have $G =\langle g\rangle\leq H_i\leq G$, so the $H_i$ are not proper subgroups. $\Box$
Lemma. A group $G$ has no proper nontrivial subgroups if and only if $G$ is cyclic of prime order.
Proof. Omitted. $\Box$
Thus $T=\varnothing$ if and only if $G$ is of prime order and cyclic, so we may assume $T\neq\varnothing$ and $G$ is not cyclic of prime order.
If $G$ is infinite, then it is isomorphic to the additive group of integers, so we may take $G=\mathbb{Z}$. Then $2,3\in T$, since $2\mathbb{Z}$ and $3\mathbb{Z}$ are proper subgroups of $G$. If $T$ were a subgroup, then $2,3\in T$ implies $1\in T$, hence $T=G$. But $G$ is cyclic, hence it is not a union of proper subgroups. Thus, $T$ cannot be a subgroup in this case.
Now assume $G$ is finite. If $G$ is not of prime power order, $|G|=p_1^{a_1}\cdots p_r^{a_r}$, $r\gt 1$, with the $p_i$ pairwise distinct and $a_i\gt 0$, we know that if $d$ divides $|G|$ then $G$ has a unique subgroup of order $d$ and in particular has elements of order $d$. Let $a\in G$ be of order $p_1^{a_1}$, and let $b$ be of order $p_2^{a_2}\cdots p_r^{a_r}$. Then $\langle a\rangle$ and $\langle b\rangle$ are proper nontrivial subgroups of $G$, so $a,b\in\langle a\rangle\cup\langle b\rangle\subseteq T$.
Any subgroup of $G$ that contains both $a$ and $b$ must contain $ab$. Since $a$ and $b$ commute, and are of relatively prime order, then the order of $ab$ is the least common multiple of the orders of $a$ and $b$. That means that $|ab| = |G|$, so $ab$ is a generator of $G$.
Since $G$ cannot be equal to $T$ (because $G$ is cyclic), and $T$ contains $a$ and $b$, then $T$ cannot be a subgroup of $G$.
Thus, if $G$ is cyclic and it is not of prime power order, then $T$ is not a subgroup.
By contrapositive, if $T$ is a subgroup, then $G$ is cyclic of prime power order.
Bonus. Prove that if $|G|=p^n$ with $n\gt 1$, then $T$ is exactly the unique maximal subgroup of $G$, of order $p^{n-1}$.
