Let $G$ s.t $|G| = p^3$ for some prime $p$. Prove or disprove: $|G'| \leq p$.
I couldn't think of any counter-examples so I started proving this and I'm stuck unfortunately and was hoping to seek some help.
So we know if $G$ is a non-trivial $p$-group then $Z(G) \neq \{e\}$ therfore we have $|Z(G)| \in \{p,p^2,p^3\}$.
Consider $|Z(G)| = p^3$, then $Z(G) = G \implies G$ is abelian $\implies G' = \{e\}$.
Otherwise consider $|Z(G)| = p \implies |{G/Z(G)}| = p^2 \implies {G/Z(G)}$ is abelian $\implies G' \leq Z(G) \implies |G'| \leq p$.
Now consider $|Z(G)| = p^2$ I haven't manage to prove this and I also can't think of any group of order $p^3$ which has a center $|Z(G)| = p^2$ so I'd love some help.
EDIT
So following Mark's hint consider $|Z(G)| = p^2$. This implies $|G/Z(G)| = p \implies G/Z(G)$ is cyclic which implies $G$ is abelian. If $G$ is abelian then $G = Z(G)$ which is a contradiction to the assumption $|Z(G)| = p^2$.
Hint: It's an easy exercise that if $G/Z(G)$ is cyclic then $G$ is abelian. So, can a group of order $p^3$ have center of order $p^2$?