Split Lie algebra extensions?

Let $\mathfrak{g}$ and $\mathfrak{h}$ be two Lie algebras. A Lie algebra extension is a short exact sequence $$0\longrightarrow \mathfrak{h}\stackrel{\jmath}{\longrightarrow} \mathfrak{e}\stackrel{\pi}{\longrightarrow} \mathfrak{g}\longrightarrow 0.$$ This extension is said to be split if there is a Lie algebra subalgebra $\mathfrak{a}$ of $\mathfrak{e}$ such that $\mathfrak{e}=\mathfrak{a}\oplus \textrm{Ker}(\pi)$.

How can I show such an extension is split if and only if there is a Lie algebra homomorphism $\sigma:\mathfrak{g}\longrightarrow \mathfrak{e}$ such that $\pi\sigma=1_{\mathfrak{g}}$?

Of course $\mathfrak{a}$ should be taken as $\mathfrak{a}=\textrm{Im}(\sigma)$ but I can only show there is an isomorphism $$\textrm{Im}(\sigma)\oplus \textrm{Ker}(\pi)\longrightarrow \mathfrak{e}, (\sigma(x), \jmath(y))\longmapsto \sigma(x)+\jmath(y)$$ but I'd like to have the equality.

Thanks

The symbol $\oplus$ actually has two different meanings: it can refer to internal direct sums or external direct sums. The external direct sum (of vector spaces, say) $A\oplus B$ is just the set $A\times B$ made into a vector space by letting the operations be defined separately on each coordinate. The internal direct sum $A\oplus B$, on the other hand, is only defined when $A$ and $B$ are both subspaces of a third vector space $C$ with the property that $A\cap B=0$. In this case, the internal direct sum $A\oplus B$ is just defined as $A+B$, i.e. the set of sums of elements of $A$ and elements of $B$. The connection between the two notions is that if $A,B\subseteq C$ have an internal direct sum, then there is an isomorphism from their external direct sum to the internal direct sum given by sending $(a,b)$ to $a+b$. (And conversely, the external direct sum is itself the internal direct sum of the subspaces $A\times 0$ and $0\times B$.)
In the case of your problem, in the statement $\mathfrak{e}=\mathfrak{a}\oplus \textrm{Ker}(\pi)$, the direct sum is meant to be an internal direct sum. That is, there is supposed to be a subalgebra $\mathfrak{a}$ of $\mathfrak{e}$ such that $\mathfrak{a}\cap\textrm{Ker}(\pi)=0$ and $\mathfrak{a}+ \textrm{Ker}(\pi)=\mathfrak{e}$. You should have no difficulty verifying that your choice $\mathfrak{a}=\textrm{Im}(\sigma)$ satisfies these conditions (since this is essentially equivalent to the isomorphism you have already given).