[guided]Assume that $i\geq 1$ and that $\gamma_i(\mathfrak g)$ is already known to be an ideal. We need to prove that the next term
\begin{align*}
\gamma_{i+1}(\mathfrak g)=[\mathfrak g,\gamma_i(\mathfrak g)]
\end{align*}
is also stable under bracketing with arbitrary elements of $\mathfrak g$.
The elements of $\gamma_{i+1}(\mathfrak g)$ are finite $k$-linear combinations of brackets $[y,z]$, where $y\in \mathfrak g$ and $z\in \gamma_i(\mathfrak g)$. Since the Lie bracket is bilinear, it is enough to check stability on these spanning generators. Thus fix $x,y\in \mathfrak g$ and $z\in \gamma_i(\mathfrak g)$, and consider $[x,[y,z]]$.
The Jacobi identity rewrites this bracket as
\begin{align*}
[x,[y,z]] = [[x,y],z] + [y,[x,z]].
\end{align*}
Now each term lies in $\gamma_{i+1}(\mathfrak g)$. For the first term, $[x,y]\in \mathfrak g$ and $z\in \gamma_i(\mathfrak g)$, so
\begin{align*}
[[x,y],z]\in [\mathfrak g,\gamma_i(\mathfrak g)] = \gamma_{i+1}(\mathfrak g).
\end{align*}
For the second term, the induction hypothesis is used: because $\gamma_i(\mathfrak g)$ is an ideal, $[x,z]\in \gamma_i(\mathfrak g)$. Since $y\in \mathfrak g$, this gives
\begin{align*}
[y,[x,z]]\in [\mathfrak g,\gamma_i(\mathfrak g)] = \gamma_{i+1}(\mathfrak g).
\end{align*}
Therefore $[x,[y,z]]$ is a sum of two elements of $\gamma_{i+1}(\mathfrak g)$, and hence belongs to $\gamma_{i+1}(\mathfrak g)$.
Finally, because arbitrary elements of $\gamma_{i+1}(\mathfrak g)$ are finite $k$-linear combinations of the generators $[y,z]$, bilinearity of the bracket gives
\begin{align*}
[\mathfrak g,\gamma_{i+1}(\mathfrak g)]\subseteq \gamma_{i+1}(\mathfrak g).
\end{align*}
This is exactly the statement that $\gamma_{i+1}(\mathfrak g)$ is an ideal of $\mathfrak g$.[/guided]