[proofplan]
We compare the lower central series of $\mathfrak g$ with the lower central series of the quotient $\mathfrak g/I$ using the quotient map. The key point is that the image of $\gamma_m(\mathfrak g)$ in the quotient is exactly $\gamma_m(\mathfrak g/I)$ for every $m \geq 1$. Once nilpotency of the quotient forces some $\gamma_{c+1}(\mathfrak g)$ to lie inside $I$, centrality of $I$ makes the next lower central term vanish.
[/proofplan]
[step:Relate the lower central series of $\mathfrak g$ to that of the quotient]
Let
\begin{align*}
\pi:\mathfrak g &\to \mathfrak g/I \\
x &\mapsto x+I
\end{align*}
be the quotient Lie algebra homomorphism. We prove that for every integer $m \geq 1$,
\begin{align*}
\gamma_m(\mathfrak g/I)=\pi(\gamma_m(\mathfrak g))=\frac{\gamma_m(\mathfrak g)+I}{I}.
\end{align*}
For $m=1$, this is
\begin{align*}
\gamma_1(\mathfrak g/I)=\mathfrak g/I=\pi(\mathfrak g)=\pi(\gamma_1(\mathfrak g)).
\end{align*}
Assume the identity holds for some integer $m \geq 1$. Since $\pi$ is a Lie algebra homomorphism, it preserves brackets:
\begin{align*}
\pi([x,y])=[\pi(x),\pi(y)]
\end{align*}
for all $x,y \in \mathfrak g$. Therefore
\begin{align*}
\gamma_{m+1}(\mathfrak g/I)
&=[\mathfrak g/I,\gamma_m(\mathfrak g/I)] \\
&=[\pi(\mathfrak g),\pi(\gamma_m(\mathfrak g))] \\
&=\pi([\mathfrak g,\gamma_m(\mathfrak g)]) \\
&=\pi(\gamma_{m+1}(\mathfrak g)).
\end{align*}
This completes the induction. The equality $\pi(\gamma_m(\mathfrak g))=(\gamma_m(\mathfrak g)+I)/I$ is the standard description of the image of a subspace under the quotient map.
[guided]
The quotient map
\begin{align*}
\pi:\mathfrak g &\to \mathfrak g/I \\
x &\mapsto x+I
\end{align*}
is a surjective Lie algebra homomorphism because $I$ is an ideal of $\mathfrak g$. We want to know how the lower central series behaves under this map. The claim is that the $m$-th lower central term of the quotient is exactly the image of the $m$-th lower central term of $\mathfrak g$:
\begin{align*}
\gamma_m(\mathfrak g/I)=\pi(\gamma_m(\mathfrak g))=\frac{\gamma_m(\mathfrak g)+I}{I}.
\end{align*}
We prove this by induction on $m$. For $m=1$, the lower central series starts with the entire Lie algebra, so
\begin{align*}
\gamma_1(\mathfrak g/I)=\mathfrak g/I=\pi(\mathfrak g)=\pi(\gamma_1(\mathfrak g)).
\end{align*}
Now assume the formula holds for some integer $m \geq 1$. The next lower central term is obtained by bracketing with the whole Lie algebra. Since $\pi$ is a Lie algebra homomorphism, it satisfies
\begin{align*}
\pi([x,y])=[\pi(x),\pi(y)]
\end{align*}
for all $x,y \in \mathfrak g$. Using the induction hypothesis, we compute:
\begin{align*}
\gamma_{m+1}(\mathfrak g/I)
&=[\mathfrak g/I,\gamma_m(\mathfrak g/I)] \\
&=[\pi(\mathfrak g),\pi(\gamma_m(\mathfrak g))] \\
&=\pi([\mathfrak g,\gamma_m(\mathfrak g)]) \\
&=\pi(\gamma_{m+1}(\mathfrak g)).
\end{align*}
The third equality holds because the bracket of the two image subspaces is spanned by brackets of the form $[\pi(x),\pi(y)]$, and each such bracket equals $\pi([x,y])$. Finally, for any subspace $A \subseteq \mathfrak g$, its image under the quotient map is $(A+I)/I$, so
\begin{align*}
\pi(\gamma_m(\mathfrak g))=\frac{\gamma_m(\mathfrak g)+I}{I}.
\end{align*}
Thus the quotient lower central series is exactly the image of the original lower central series.
[/guided]
[/step]
[step:Use nilpotency of the quotient to force a lower central term into the central ideal]
Assume $\gamma_{c+1}(\mathfrak g/I)=0$ for some integer $c \geq 0$. By the quotient formula from the previous step,
\begin{align*}
0=\gamma_{c+1}(\mathfrak g/I)=\frac{\gamma_{c+1}(\mathfrak g)+I}{I}.
\end{align*}
Hence $\gamma_{c+1}(\mathfrak g)+I=I$, and therefore
\begin{align*}
\gamma_{c+1}(\mathfrak g)\subseteq I.
\end{align*}
[/step]
[step:Bracket once more and use centrality to terminate the lower central series]
Since $I \subseteq Z(\mathfrak g)$, every element of $I$ brackets to zero with every element of $\mathfrak g$. Therefore
\begin{align*}
[\mathfrak g,I]=0.
\end{align*}
Using $\gamma_{c+1}(\mathfrak g)\subseteq I$, we obtain
\begin{align*}
\gamma_{c+2}(\mathfrak g)
&=[\mathfrak g,\gamma_{c+1}(\mathfrak g)] \\
&\subseteq [\mathfrak g,I] \\
&=0.
\end{align*}
Thus the lower central series of $\mathfrak g$ terminates. Hence $\mathfrak g$ is nilpotent, with nilpotency class at most $c+1$.
[/step]