Let $\mathfrak{g}$ be a finite dimensional Lie algebra and let $M$ and $N$ be (not necessarily finite dimensional) $\mathfrak{g}$-modules over a field $k$. Let $f: M\to N$ be an injective $k$-linear map of $\mathfrak{g}$-modules.
We know that $f$ has a left inverse in the category of $k$-vector spaces but does it have a left inverse in the category of $\mathfrak{g}$-modules? Thank you for a proof or a simple counterexample.
By the splitting lemma this is true iff the short exact sequence
$$0 \to M \to N \to N/M \to 0$$
splits. If this is true for every $M, N$ then the category of $\mathfrak{g}$-modules must be semisimple, which I think never happens unless $\mathfrak{g} = 0$ (not even if $\mathfrak{g}$ is semisimple; that only guarantees semisimplicity of finite-dimensional representations, and maybe that even requires hypotheses on the field?).
In any case it's easy to give a counterexample: let $\mathfrak{g} = k$ be the one-dimensional abelian Lie algebra, so that a $\mathfrak{g}$-module is equivalently a $k[x]$-module ($k[x]$ is the universal enveloping algebra). Then, for example, the $2$-dimensional representation given by the Jordan block
$$x \mapsto \left[ \begin{array}{cc} 0 & 1 \\ 0 & 0 \end{array} \right]$$
is a nontrivial extension of the trivial representation by itself, hence corresponds to a short exact sequence $0 \to k \to V \to k \to 0$ which does not split.
Edit: Here's a proof of the general claim.
Proof. Since the category of $\mathfrak{g}$-modules is equivalently the category of $U(\mathfrak{g})$-modules, we want to show that the universal enveloping algebra $U(\mathfrak{g})$ is semisimple iff $\mathfrak{g} = 0$. The PBW theorem implies that $U(\mathfrak{g})$ is an integral domain; by the classification of semisimple algebras it follows that $U(\mathfrak{g})$ is semisimple iff it is a division algebra over $k$. But $U(\mathfrak{g})$ admits an augmentation homomorphism to $k$ given by sending every element of $\mathfrak{g}$ to zero; hence if it's a division algebra over $k$ it must be $k$ itself. $\Box$