If $H\leq Z (G)$ and $G/H$ is nilpotent, then $G$ is nilpotent.
Solution 1:
I have the solution in my old notes:
$G/H$ is nilpotent, for example of class $m$, so $L_{m+1}(G/H)=H/H$. We can probe this fact that $L_{m+1}(G/H)=L_{m+1}(G)H/H$ so,$$L_{m+1}(G)H/H=H/H$$ or $L_{m+1}(G)\subset H$. Since $H\subset Z(G)$ then $L_{m+1}(G)=[L_m(G),G]\leq[H,G]=\{e\}$. This is what we need
Solution 2:
Hint: Consider the upper central series of $G$ and the upper central series of $G/H$. What is the connection between $Z_{i}(G/H)$ and $Z_i(G)$? Can you show that $Z_r(G)=G$ for some $r$, knowing that $H\leqslant Z(G)$?
If you aren't familiar, the upper central series of a group $K$ is $$1=Z_0\lhd Z_1 \lhd \cdots \lhd Z_i \lhd \cdots $$ where $Z_i/Z_{i-1}=Z(K/Z_{i-1})$. $K$ is nilpotent if and only if $Z_r=K$ for some $r\in \mathbb{N}$.
Solution 3:
So you want to show that $G/Z(G)$ has a non-trivial center. First, assume that $G$ is not abelian, or you would be done anyway. Next, use that $G/Z(G)$ is a quotient of $G/H$ since $H$ is contained in $Z(G)$. This tells you that $G/Z(G)$ is abelian. Now you should be able to complete the proof.