$G/Z(G)$ is cyclic then is abelian? my question is if $G/Z(G)$ is order of p then is commutative then is abelian group but if G is abelian then $G=Z(G)$ therefore $G/Z(G)$ is not order of p?Is it contradiction?

It shows $|G/Z(G)|=$ prime $p$ can't hold. The only way $G/Z(G)$ can be cyclic is in the most obvious of ways: when it is trivial. It is a useful fact that shows up a lot in exercises. E.g., reasoning by contradiction at some step you end up concluding that the index of $Z(G)$ in $G$ is prime, and, voilà, you get that $G$ must be abelian.
