Is there a Lie Algebra $\mathfrak g$ so that the extension
$$0\xrightarrow{}\mathfrak h\xrightarrow{}\mathfrak g\xrightarrow{}\mathfrak q\xrightarrow{}0$$
does not split, i.e. $\mathfrak g$ is not a semi-direct product of $\mathfrak h$ and $\mathfrak q$? As I understand it, $\mathfrak q$ should not be identifiable with a subalgebra of $\mathfrak g$, right? Since $\mathfrak h$ is already an ideal in $\mathfrak g$ as the kernel.
I guess the Heisenberg algebra will do. This is the algebra $\mathfrak{g}$ with basis $a, b, c$, and products $[a, b] = c$, $[a, c] = [b, c] = 0$. Take $\mathfrak{h} = \langle c \rangle$. Then $\mathfrak{q}$ is a two-dimensional abelian algebra, and all such object in $\mathfrak{g}$ contain $c$.