Solution (source code)

= Solution

Let $\mathfrak g=\mathfrak{sl}_2(\mathbb C)$ and let $V=\mathbb C^2$ be its defining irreducible representation. Set
$$
\mathfrak h=\mathfrak g\ltimes V.
$$
Since $[\mathfrak g,\mathfrak g]=\mathfrak g$ and $\mathfrak gV=V$,
$$
[\mathfrak h,\mathfrak h]=\mathfrak g\oplus V=\mathfrak h.
$$
If $(x,v)$ is central, commuting with every $(0,w)$ gives $xw=0$ for all $w$, so faithfulness of the defining representation gives $x=0$. Commuting with every $(y,0)$ then gives $yv=0$ for all $y$; irreducibility and nontriviality give $v=0$. Thus $Z(\mathfrak h)=0$.

The nonzero abelian subspace $V$ is a proper <ideal of a Lie algebra>, so $\mathfrak h$ is not simple. It is not a direct product of simple Lie algebras either, because such a product is semisimple and has no nonzero solvable ideal, whereas $V$ is one.