Question
If $|G|=p^3$ and $G$ is not abelian show that $G'=Z(G)$
Attempt
Since $|G|=p^3$ then $G$ is solvable and let $$1\leq G^{(n-1)}\leq...\leq G^{(n)}=G,(1)$$ be its derived series.We know that $G^{(n-1)}$ is an abelian subgroup of $G$ so $|G^{(n-1)}|=p$ or $p^2$ (since $G$ is not abelian).Hence we have that $\bigg|\dfrac{G}{G^{(n-1)}}\bigg|=p$ or $p^2$ so $\dfrac{G}{G^{(n-1)}}$ is abelian $\Rightarrow G'\leq G^{(n-1)}$ so $(1)$ is $1\leq G' \leq G,(2)$.
Furthermore, $Z(G)\not=1$ (since $G$ is a $p-$group) and $\dfrac{G}{Z(G)}$ is abelian $\Rightarrow G'\leq Z(G)$
Is this correct so far? How could I continue?
Everything you've written is correct, though in the derived series you would have $G'=G^{(n-1)}$ by definition.
You can actually prove this in three small steps. First that $G'\le Z(G)$ you have done.
Second show $|Z(G)|=p$, to do this suppose not and consider the quotient (if quotient by $Z(G)$ is cyclic you can show that $G$ is abelian)
Third show $G'$ is non-trivial, for which you need only show there are elements $x,y\in G$ with $[x,y]\ne 1$