If the factor group with respect to the center of $G$ is cyclic, then $(aZ(G))^n=gZ(G)$ for some $n$ and any $g$, where both $a$ and $g$ are from $G$ (and $a^n$ is, too).
Because of the definition of the operation on the factor group it should be correct that $a^nZ(G)=gZ(G)$.
How come $G$ is not cyclic, too?
This question has been ressurrected, so we might as well.
The fact that if $G/N$ is cyclic and $N\subseteq Z(G)$ then $G$ is abelian (and hence $G/Z(G)$ is in fact trivial) has been asked and answered before (many times) and I have expressed my dislike for that phrasing several times, too.
Now the question here is: why is it we can't conclude that $G$ itself was in fact cyclic? The argument given is okay as far as it goes: there exists $g\in G$ such that for every $a\in G$ there exists $n\in\mathbb{N}$ such that $aN = g^nN$ (I'm using my formulation of a central subgroup $N$). That means that $a^{-1}g^n\in N$, not that $a=g^n$, so we cannot conclude that $G=\langle g\rangle$.
Of course, this is a much more general phenomenon. It is just a reflection that, in general, if $H$ is a subgroup of $G$, and $x,y\in G$ are such that $xH=yH$, we cannot conclude $x=y$ (except in the literally trivial case of $H=\{e\}$). We can only conclude that there exists $h\in H$ with $x=yh$.