I'm trying to prove that every group which has order equal to a power of a prime has an element of order $p$.
The first doubt I have is that if $|G| = p^0$ for some prime $p$, then $G$ is just the trivial group consisting only of the identity element, which doesn't have prime order. So I believe what this theorem is really saying is a "positive" power of a prime. Is that a correct interpretation? I'm going to proceed in my attempt under the assumption that $|G| = p^n$ for some $n > 0$.
EDIT: I made a mistake in my original argument and wrongly asserted that $G$ was cyclic. Here is my updated attempt based on some helpful feedback.
Let $G$ be a group of order $p^n$ for some prime $p$ and $n > 0$. Then $|G| > 1$, so $G$ contains a non-trivial element $g$. Because $g$ generates a cyclic subgroup of order $|\langle g \rangle| = |g|$, the order of $g$ must divide $p^n$ by Lagrange's theorem. So $|g| = p^k$ for some $1 \leq k \leq n$. Then the cyclic subgroup generated by $g$ is $$ \langle g \rangle = \left\{e, g, g^2, \ldots, g^{p^{k-1}} \right\}. $$ Consider $g^{p^{k-1}}$. Then $$ \left(g^{p^{k-1}}\right)^p = g^{p^k} = e, $$ so $g^{p^{k-1}}$ has order $p$.
How does this look?