Let $G\ne\{e\}$ be a $p$-group. Then there exists $x\in Z(G)$ such that $x\ne e$. Let $k>0$ such that $x^{p^k}=e$: i.e. let $p^k$ be the order of the element $x$. I would like to show that the order of the element $x^{p^{k-1}}$ is $p$. Obviously $$\left(x^{p^{k-1}}\right)^p=x^{p^{k-1}p}=x^{p^{k-1+1}}=x^{p^k}=e.$$
Let $n>0$ such that $\left(x^{p^{k-1}}\right)^n=e$. I am having difficulty showing that $p\leq n$. Any suggestions?
I will use this proposition from Dummit and Foote page 57:
Since $|x|=p^{k}$, we have $|x^{p^{k-1}}|=\frac{p^{k}}{(p^{k},p^{k-1})}=\frac{p^{k}}{p^{k-1}}=p$.
If you do not want to use the proposition, then let $n$ be as you defined. Then $(x^{p^{k-1}})^{n}=x^{p^{k-1}n}=e$. Since $|x|=p^{k}$, we have $p^{k}\leq p^{k-1}n$. So $p\leq n$.