My book's proof:
Clearly, this statement is true for the case in which $G$ has order 2. We prove the theorem by using the Second Principle of Mathematical Induction on $|G|$. That is, we assume that the statement is true for all Abelian groups with fewer elements than G and use this assumption to show that the statement is true for G as well. Certainly, G has elements of prime order, for if $|x| = m$ and $m = qn$, where $q$ is prime, then $|x^n| = q$. So let $x$ be an element of $G$ of some prime order $q$, say. If $q=p$, we are finished; so assume that $q \neq p$. Since every subgroup of an Abelian group is normal, we may construct the factor group $\bar{G} = G/\langle x\rangle$. Then $\bar{G}$ is Abelian and $p$ divides $|G|$, since $|\bar{G}| = |G|/q$. By induction, then, $G$ has an element — call it $y\langle x\rangle$ — of order $p$. Then, $(y\langle x\rangle)^p = y^p\langle x\rangle = \langle x\rangle$ and therefore $y^p \in \langle x\rangle$. If $y^p = e$, we are done. If not, then $y^p$ has order $q$ and $y^q$ has order $p$. $\blacksquare$
I can understand the proof until this step:
If $y^p$ has order $q$ , then $y^q$ has order $p$.
But if $(y^p)^q=e$, and thus $(y^q)^p=e$, then all we can say is that: $y^q$ has order 1 or p, how did we exclude the first possibility?
If $y^q$ has order 1, then $y^q = e$. In particular, in the factor group $\bar{G} = G/\langle x\rangle$ we also have that $(y\langle x\rangle)^q = y^q \langle x\rangle = \langle x\rangle$, and since $q$ is prime that means the order of $y \langle x\rangle$ is 1 or $q$, a contradiction!
So the order must be $p$.