I've been self teaching myself some topics in preparation for university and thought I'd have a go at some past paper questions from their website. As such I do not have much experience with these questions.
Here's the question:
For prime $p$, let $G$ be a group such that every non-identity element of $G$ has order $p$. Show that if $|G|$ is finite, then $|G| = p^n$ for some $n$. [You must prove any theorems that you use.]
I have proven Lagrange's theorem but can't see where else to go.
It seems that this is related to p-groups and Sylow's theorems but I can't seem to find quite what I'm looking for online, at least not directly.
I suspect it's probably incredibly simple but I just can't see it. I'm also hesitant to spend too long on the question in case it requires knowledge I don't have, although I suspect not.
Thanks in advance.
Hint: use Sylow theorem: if a prime $q$ divides $|G$ there exists a non trivial sylow $q$-subgroup which has an element of order $q^n$ by Lagrange.