My professor talked about a central extension of a Lie algebra $\mathfrak g$, which he defined as $\tilde{\mathfrak{g}}=\mathfrak g\oplus\mathbb C$. The Lie bracket on $\tilde{\mathfrak{g}}$ is
$$\widetilde{[a,b]}=[a,b]+k\eta(a,b)$$
where $k$ is the base vector of $\mathbb C$ and $\eta:\mathfrak g\oplus\mathfrak g\to\mathbb C$ a bilinear form.
For $\tilde{\mathfrak{g}}$ to be a Lie algebra, $\eta$ must be asymmetric. Furthermore, because of the Jacobi identity of $\tilde{\mathfrak{g}}$, $\eta$ must satisfy
$$\tag{1}\eta([a,b],c)+\eta([b,c],a)+\eta([c,a],b)=0$$
for all $a,b,c\in\mathfrak g$.
Then he mentioned that these requirements are exactly those that make $\eta$ a 2-cocycle of $\mathfrak g$.
To my knowledge, a 2-cocycle of $\mathfrak g$ is defined as an asymmetric bilinear form $\eta$ on $\mathfrak g$ that satisfies $\mathrm{d}\eta=0$, i.e.
\begin{align} 0 & = \mathrm{d}\eta(a,b,c) \\ \tag{2}&= \underbrace{-\eta(a,b)-\eta(b,c)-\eta(c,a)}_{(*)}+\eta([a,b],c)+\eta([b,c],a)+\eta([c,a],b) \end{align}
Why is $(1)$ the same as $(2)$? In other words, why do the first three terms $(*)$ in $(2)$ vanish?
EDIT: I think I understand the argument by @TsemoAristide, but I wanted to write it out explicitly to see why I was wrong exactly.
The Lie algebra $\tilde{\mathfrak{g}}$ has to satisfy the Jacobi identity, so we get
\begin{align} 0 &= \widetilde{[a,\widetilde{[b,c]}]} + (\text{even permutations})\\ &= \widetilde{[a, [b,c]]}+\widetilde{[a,k\eta(b,c)]}+(\text{p.})\\ &= \underbrace{[a,[b,c]]}_{\text{Jacobi-Identity of }\mathfrak{g}}+k\eta(a,[b,c])+\underbrace{k[a,\eta(b,c)]}_{=0\text{ since }\eta(b,c)\text{ is in }\mathbb C}+\underbrace{k^2}_{=k}\eta(a,\eta(b,c))+(\text{p.})\\ &= k(\eta(a,[b,c])+\eta(a,\eta(b,c))+(\text{p.}))\\ \end{align}
From that we can conclude that
\begin{align} \tag{3} 0 &= \eta(a,[b,c])+\eta(a,\eta(b,c))+(\text{p.})\\ \end{align}
Is that correct so far?
So we indeed get more terms than just $(1)$. However, $(3)$ is still not the same as $(2)$. What's wrong?
The action of $\mathfrak g$ on $\mathbb C$ is supposed to be trivial. You have forgotten this action in the "non zero terms"
$-c\cdot\eta(a,b)-a\cdot\eta(b,c)-b\cdot\eta(a,c)=0$ since $c\cdot\eta(a,b)=a\cdot\eta(b,c)=b\cdot\eta(a,c)=0$
https://en.wikipedia.org/wiki/Lie_algebra_cohomology#Chevalley-Eilenberg_complex