[guided]The goal is to show that the operation “take the next derived algebra” is compatible with passing through the homomorphism $\varphi$. We prove the exact formula
\begin{align*}
\mathfrak a_i = \varphi(\mathfrak g_i)
\end{align*}
for every $i \geq 0$.
The base case is the definition of the image:
\begin{align*}
\mathfrak a_0 = \mathfrak a = \varphi(\mathfrak g) = \varphi(\mathfrak g_0).
\end{align*}
Now assume that $\mathfrak a_i=\varphi(\mathfrak g_i)$ for some fixed integer $i \geq 0$. We need to prove
\begin{align*}
\mathfrak a_{i+1}=\varphi(\mathfrak g_{i+1}).
\end{align*}
This requires two inclusions.
For the inclusion $\varphi(\mathfrak g_{i+1}) \subset \mathfrak a_{i+1}$, take $w \in \varphi(\mathfrak g_{i+1})$. Then $w=\varphi(z)$ for some $z \in \mathfrak g_{i+1}$. By definition, $\mathfrak g_{i+1}$ is the $k$-linear span of brackets of elements of $\mathfrak g_i$, so there are an integer $N \geq 1$, scalars $c_1,\dots,c_N \in k$, and elements $x_1,\dots,x_N,y_1,\dots,y_N \in \mathfrak g_i$ with
\begin{align*}
z = \sum_{r=1}^{N} c_r [x_r,y_r]_{\mathfrak g}.
\end{align*}
Applying $\varphi$, using its linearity, and then using the homomorphism identity gives
\begin{align*}
w
&= \varphi(z) \\
&= \sum_{r=1}^{N} c_r \varphi([x_r,y_r]_{\mathfrak g}) \\
&= \sum_{r=1}^{N} c_r [\varphi(x_r),\varphi(y_r)]_{\mathfrak h}.
\end{align*}
Because $x_r,y_r \in \mathfrak g_i$, the induction hypothesis gives $\varphi(x_r),\varphi(y_r) \in \varphi(\mathfrak g_i)=\mathfrak a_i$. Hence the last expression is a $k$-linear combination of brackets of elements of $\mathfrak a_i$, which means
\begin{align*}
w \in [\mathfrak a_i,\mathfrak a_i]_{\mathfrak h}=\mathfrak a_{i+1}.
\end{align*}
For the reverse inclusion $\mathfrak a_{i+1} \subset \varphi(\mathfrak g_{i+1})$, take $w \in \mathfrak a_{i+1}$. Since $\mathfrak a_{i+1}$ is the $k$-linear span of brackets of elements of $\mathfrak a_i$, there are an integer $M \geq 1$, scalars $d_1,\dots,d_M \in k$, and elements $u_1,\dots,u_M,v_1,\dots,v_M \in \mathfrak a_i$ such that
\begin{align*}
w = \sum_{s=1}^{M} d_s [u_s,v_s]_{\mathfrak h}.
\end{align*}
The induction hypothesis says $\mathfrak a_i=\varphi(\mathfrak g_i)$, so each $u_s$ and $v_s$ has a preimage inside $\mathfrak g_i$. Thus, for every $s$, choose $p_s,q_s \in \mathfrak g_i$ such that
\begin{align*}
u_s=\varphi(p_s),
\qquad
v_s=\varphi(q_s).
\end{align*}
Substituting these preimages and using the homomorphism identity,
\begin{align*}
w
&= \sum_{s=1}^{M} d_s [\varphi(p_s),\varphi(q_s)]_{\mathfrak h} \\
&= \sum_{s=1}^{M} d_s \varphi([p_s,q_s]_{\mathfrak g}) \\
&= \varphi\left(\sum_{s=1}^{M} d_s [p_s,q_s]_{\mathfrak g}\right).
\end{align*}
The element inside $\varphi$ belongs to $[\mathfrak g_i,\mathfrak g_i]_{\mathfrak g}=\mathfrak g_{i+1}$. Therefore $w \in \varphi(\mathfrak g_{i+1})$.
Both inclusions hold, so $\mathfrak a_{i+1}=\varphi(\mathfrak g_{i+1})$. The induction is complete.[/guided]