Show that if $G/Z(G)$ is nilpotent, then $G$ is nilpotent, check of proof I am trying to see if my proof for the statement in the title is wrong and where, but I can't find a solution to this. Can anybody help me out? My proof goes as follows:
Suppose $G/Z(G)$ Is nilpotent. This is equivalent to every maximal subgroup of $G/Z(G)$ being normal. Consider the surjective projection map $\phi: G \rightarrow G/Z(G)$. Also, let $\overline{M}$ be a maximal subgroup of $G/Z(G)$ which is normal. Now, let $M$ be the preimage of $\overline{M}$ such that $\phi(M)= \overline{M}$. We will show $M$ is maximal in $G$. So let $H$ be a proper subgroup of $G$ such that $Z(G) \subseteq M \subseteq H \subset G$. Then under $\phi$, $\phi(H)$ is a proper subgroup of $G/Z(G)$ containing $\overline{M}$, but this is a contradiction to the maximality of $\overline{M}$ so no such subgroup $H$  exists and $M$ is maximal in $G$.
Now, we show that $M$ is normal. Let $\overline{g} \in G/Z(G)$ and $\overline{m} \in \overline{M}$ Since $\overline{M}$ is normal in $G/Z(G)$ and $\phi$ is surjective, we can finde some $g \in G$ and some $m \in M$ such that $\phi(g) = \overline{g}$ and $\phi(m) = \overline{m}$. Then by normality $\overline{M}$ in  $G/Z(G)$, we know $\overline{m}\overline{g}\overline{m}^{-1} \in \overline{M}$ and so $\phi(gmg^{-1}) = \phi(g)\phi(m)\phi(g)^{-1} = \overline{g}\overline{m}\overline{g}^{-1} \in \overline{M} = \phi(M)$ which implies that $gmg^{-1} \in M $ and so this implies that $M$ is normal in $G$. Since $M$ was an arbitrary maximal group in $G$, we can say every maximal group in $G$ is normal and therefore $G$ is nilpotent. 
 A: Instead of relying on a characterization by maximal subgroups, this statement is tailor-made for a proof that uses the upper central series.  The first term is $(1)$, the second term is $Z(G)$ (the preimage of $(1)Z(G)$ in $G$) and the remaining terms are the preimages in $G$ of the rest of the upper central series of $G/Z(G)$.  Since the latter reaches all of $G/Z(G)$, the former reaches $G$.
A: Let me finish your proof, since another answer provides an alternative way of looking at things. So we want to prove:

If every maximal subgroup of $G/Z(G)$ is normal, then every maximal subgroup of $G$ is normal.

First, get rid of the case when $G$ is abelian (which is precisely the case where $G/Z(G)$ is trivial). The conclusion is of course true for abelian groups.
Now if $Z(G)\le M\le G$ is a maximal subgroup of $G$, then $M/Z(G)$ is maximal in $G/Z(G)$, hence is normal in $G/Z(G)$, hence is normal in $G$.  This is usually called the "fourth isomorphism theorem" (or "correspondence theorem"). This is the case you already handled.
If $Z(G)\not\le M$, then $MZ(G)$ is a subgroup of $G$ properly containing $M$, and hence we have $MZ(G)=G$. But of course $Z(G)\le N_G(M)$ (as the center normalizes everything), so $G=MZ(G)\le N_G(M)$, meaning $M$ is already normal in $G$ (no hypothesis on $G/Z(G)$ necessary).
So our proof is done.  But note that I haven't mentioned "nilpotent" here, because "every maximal subgroup normal" is not equivalent to nilpotency in infinite groups.  I've also phrased things so that the existence of maximal subgroups is not assumed.
