That if $G/Z$ is cyclic, $G$ is abelian is provable. I just wanted to see if the statement holds given the weaker assumption that $G/Z$ is abelian instead of being cyclic(cyclic is stronger because cyclic anyway implies abelian). So far I could do the following:
Since $G/Z$ is abelian,
$$Za Zb=Zb Za$$ for some $a,b \in G.$ Since $Z$ is a normal subgroup as well so left cosets are same as right cosets. $$\therefore ZZab=ZZba$$ Thus we have finally, $$Zab=Zba \implies ab(ba)^{-1} \in Z.$$ How do I proceed from here to prove that $ab=ba$.
It won't work. (I mean, your proposed idea of replacing "$G/Z$ cyclic" with "$G/Z$ abelian." Being Abelian is not sufficient.)
Consider the dihedral group of order $8$ and its center.