If $\pi$ is a representation of a lie algebra $\mathfrak{g}$, why is $\pi(x)$ not required to be invertible? The definition of a representation of a group $G$ is a homomorphism $\pi: G\to GL(V)$. So here $\pi(x)$ is an invertible linear map $V \to V$.
The definition of a representation of a lie algebra $\mathfrak{g}$ is a homomorphism $\pi: \mathfrak{g} \to End(V)$. So here $\pi(x)$ is just a linear map.
What is the motivation for not requiring invertibility? Is this something with category theory?

For a representation of a group you don’t need to require $π(g)$ to be invertible:
a representation of group $G$ is a pair $(V, π)$ consisting of a vector space $V$ and a homomorphism of monoids $π \colon G \to \operatorname{End}(V)$. More explicitly: the map $π$ needs to be multiplicative, so that $π(gh) = π(g)π(h)$ for any two elements $g$ and $h$ of $G$, and it needs to satisfy $π(1_G) = 1_{\operatorname{End}(V)}$.
However, it then turns out that $π(g)$ is actually invertible for every element $g$ of $G$.
This then allows us to regard $π$ not only as a homomorphism of monoids from $G$ to $\operatorname{End}(V)$, but also as a homomorphism of groups from $G$ to $\operatorname{GL}(V)$.
(Which is why most people don’t bother with $\operatorname{End}(V)$ and just use $\operatorname{GL}(V)$ to begin with.)
