Suppose g is a fiinte dimensional semisimple lie algebra over a field with characteristic 0. This question is related to Whitehead's second lemma, which says for finite dimensional gmodule M, H^2(g,M)=0. The solution of this question gives a counterexample to Whitehead's second lemma for infinite dimensional gmodule.

It seems that the idea of the question partly was to have a
counterexample to Whitehead's second lemma. However this can be easily given by considering Verma modules (which are infinitedimensional). 


This is false. Consider the example of $\mathfrak{g}=\mathfrak{sl}(2,\mathbb{C})$, and let $J$ be the augmentation ideal of $U(\mathfrak{g})$. Firstly $H^2(\mathfrak{g}, J) = \operatorname{Ext}^2_{U(\mathfrak{g})}(\mathbb{C},J) \cong \operatorname{Ext}^1_{U(\mathfrak{g})}(J,\mathbb{C})$ by Corollary 7.2 of AuslanderGorenstein Rings by Ajitabh, Smith and Zhang. Then by dimension shifting $\operatorname{Ext}_{U(\mathfrak{g})}^1(J,\mathbb{C}) = \operatorname{Ext}_{U(\mathfrak{g})}^2(\mathbb{C},\mathbb{C})$ which is zero by the second Whitehead lemma. The question appears as Exercise 6.3 in Hilton and Stammbach's A course in homological algebra. I guess they meant to ask about $\operatorname{Ext}^2_{U(\mathfrak{g})}(J, \mathbb{C})$ since they say to use the previous exercise which shows $\operatorname{Ext}^3_{U(\mathfrak{g})}(\mathbb{C}, \mathbb{C})\neq 0$ 

