This isn't true. Take a nonabelian group $G$ of order $p^3$. Its center $C$ has order $p$, so $G/C$ has order $p^2$ and is thus abelian, meaning the center of $G/C$ is $G/C$.
For an example where the center of $G/C$ is neither the identity nor $G/C$ itself, take $G=S_4\times Q_8$, where $S_4$is the symmetric group on 4 elements and $Q_8$ is the group of quaternions.