$|G|=p^3$, prove that $p$ divides |Z(G)|. Suppose that a group $G$ has order $p^{3}$ where $p$ is prime. How would I prove that $p$ divides $|Z(G)|$?
 A: Let's assume $G$ is a $p$-group. Your question is a particular case of a $p$-group.
We make use of the class formula : $|G| = |Z|+ \sum_{i=1}^k |c_i|$, where $Z$ is the center of $G$ and $c_k$ is non-trivial conjugacy class with size $> 1$ of $G$.
Note that for every $1 \leq i \leq k$, $|c_i| |G_x|=|G|$. Since $G$ is a $p$-group, then $|G_x|$ is of order a power of $p$, but less than $|G|$. Then $p$ should divide the order of every conjugacy class.
Then, in the class formula, $p$ divides $\sum_{i=1}^k |c_i|$. It implies $p$ divides $|G|-|Z|$. But $p$ is a prime dividing $|G|$. It quickly implies $p$ divides $|Z|$.
(In fact, I am also learning $p$-groups, so my work may not be perfect. Free feel to discuss together!)
A: Suppose there is one element in center. Let's define $\text{orb}(g)$ is an orbit of element $g$ under the action of group $G$. Using well-known theorem $|\text{orb}(g)|$  divides $|G|$. So if it is only one element in center then all other elements has in their orbits at least $p$ elements. And also if we will sum through all elements in all different orbits we will get $|G|$. Since $\text{orb}(e) = \{e\}$ we have: $|G| = 1 + p(\dots)$ which is impossible. So in center there is more than $1$ element and it have to divide $p^3$. Thus it have to be $p^n, 1 \leq n \leq 3$.
