Let $\phi:V\to W$ be a linear map between the irreducible $\mathfrak{g}$-modules $V,W$.
I want to show that $\ker(\phi)$ is a $\mathfrak{g}$-invariant subspace of $V$ and $\text{im}(\phi)$ is a $\mathfrak{g}$-invariant subspace of $W$.
First we show that $\ker(\phi)$ is a subspace of $V$.
$a,b\in \ker(\phi)$ then $\phi(a)=\phi(b)=0$ and then $\phi(a)+\phi(b)=\phi(a+b)=0\implies a+b\in \ker(\phi)$. Also $\forall a\in \Bbb F, b\in \ker(\phi) \implies a\phi(b)=0\implies \phi(ab)=0$
So $\ker(\phi)$ is a subspace of $V$.
Now showing it is $\mathfrak{g}$-invariant, I believe, means to show that $\mathfrak{g}(\ker(\phi))\subseteq \ker(\phi)$. Where $\mathfrak{g}(\ker(\phi))=\{w\in V: w=xv,x\in \mathfrak{g},v\in V\}$
Not super sure here Now first, $x\in \mathfrak{g}$ means $x$ is a vector and this is defined as a left $\mathfrak{g}$-module and this is left multiplication, so we are 'multiplying' $x$ and $v$, both vectors. So first we have to worry about compatibility, and secondly, I can't just take $\phi(xv)=x\phi(v)=0$ to get this in the kernel, since $x\not\in \Bbb F$ right?