[proofplan]
We first measure the failure of equivariance of $\mu$ by comparing $\mu(g\cdot p)$ with the coadjoint translate $g\cdot\mu(p)$. The moment-map equation and the transformation rule for fundamental vector fields show that this difference has zero differential in $p$, hence is constant because $M$ is connected. The group cocycle identity follows by inserting and subtracting $g\cdot\mu(h\cdot p)$. Finally, differentiating this group cocycle gives the infinitesimal defect, which is the displayed scalar [Lie algebra](/page/Lie%20Algebra) $2$-cocycle; changing the moment map by a constant changes this cocycle by an exact Chevalley-Eilenberg coboundary.
[/proofplan]
[step:Show that the equivariance defect is constant on the connected manifold]
Fix $g\in G$ and $\xi\in\mathfrak g$. Define the smooth function
\begin{align*}
F_{g,\xi}:M&\to\mathbb R
\end{align*}
by
\begin{align*}
F_{g,\xi}(p)=\bigl(\mu(g\cdot p)-g\cdot\mu(p)\bigr)(\xi).
\end{align*}
Equivalently, using the coadjoint action convention,
\begin{align*}
F_{g,\xi}(p)=\mu^\xi(g\cdot p)-\mu^{\operatorname{Ad}_{g^{-1}}\xi}(p).
\end{align*}
Let $p\in M$ and $v\in T_pM$. Since the action is by symplectomorphisms, the diffeomorphism
\begin{align*}
L_g:M&\to M
\end{align*}
defined by $L_g(p)=g\cdot p$ satisfies $L_g^*\theta=\theta$. The fundamental vector fields transform by
\begin{align*}
d(L_g)_p\bigl((\operatorname{Ad}_{g^{-1}}\xi)_M\bigr)_p=(\xi_M)_{g\cdot p}.
\end{align*}
Using the moment-map equation twice, we obtain
\begin{align*}
dF_{g,\xi}|_p(v)=d\mu^\xi|_{g\cdot p}(d(L_g)_p v)-d\mu^{\operatorname{Ad}_{g^{-1}}\xi}|_p(v).
\end{align*}
Thus
\begin{align*}
dF_{g,\xi}|_p(v)=\theta_{g\cdot p}((\xi_M)_{g\cdot p},d(L_g)_p v)-\theta_p((\operatorname{Ad}_{g^{-1}}\xi)_M)_p,v).
\end{align*}
Using $L_g^*\theta=\theta$ and the transformation rule for fundamental vector fields, the two terms are equal. Hence
\begin{align*}
dF_{g,\xi}|_p(v)=0.
\end{align*}
Since $p$ and $v$ were arbitrary, $dF_{g,\xi}=0$ on $M$. Because $M$ is connected, $F_{g,\xi}$ is constant.
Since this holds for every $\xi\in\mathfrak g$, the map
\begin{align*}
p\mapsto \mu(g\cdot p)-g\cdot\mu(p)
\end{align*}
is constant as a map from $M$ to $\mathfrak g^*$. Therefore $c(g,p)$ is independent of $p$, and we write its value as $c(g)$.
[guided]
Fix $g\in G$. To prove that $\mu(g\cdot p)-g\cdot\mu(p)$ is independent of $p$, it is enough to test it against an arbitrary element $\xi\in\mathfrak g$, because elements of $\mathfrak g^*$ are determined by their values on $\mathfrak g$. Define
\begin{align*}
F_{g,\xi}:M&\to\mathbb R
\end{align*}
by
\begin{align*}
F_{g,\xi}(p)=\bigl(\mu(g\cdot p)-g\cdot\mu(p)\bigr)(\xi).
\end{align*}
The coadjoint convention gives
\begin{align*}
(g\cdot\mu(p))(\xi)=\mu(p)(\operatorname{Ad}_{g^{-1}}\xi),
\end{align*}
so
\begin{align*}
F_{g,\xi}(p)=\mu^\xi(g\cdot p)-\mu^{\operatorname{Ad}_{g^{-1}}\xi}(p).
\end{align*}
Let $L_g:M\to M$ be the diffeomorphism $L_g(p)=g\cdot p$. We differentiate $F_{g,\xi}$ at $p\in M$ in the direction $v\in T_pM$. The chain rule gives
\begin{align*}
dF_{g,\xi}|_p(v)=d\mu^\xi|_{g\cdot p}(d(L_g)_p v)-d\mu^{\operatorname{Ad}_{g^{-1}}\xi}|_p(v).
\end{align*}
The moment-map convention says that $d\mu^\zeta=\iota_{\zeta_M}\theta$ for every $\zeta\in\mathfrak g$. Applying this with $\zeta=\xi$ and with $\zeta=\operatorname{Ad}_{g^{-1}}\xi$ gives
\begin{align*}
dF_{g,\xi}|_p(v)=\theta_{g\cdot p}((\xi_M)_{g\cdot p},d(L_g)_p v)-\theta_p((\operatorname{Ad}_{g^{-1}}\xi)_M)_p,v).
\end{align*}
The key point is that the two vector fields appearing here are the same vector field transported by $L_g$. Indeed, for the left action,
\begin{align*}
d(L_g)_p\bigl((\operatorname{Ad}_{g^{-1}}\xi)_M\bigr)_p=(\xi_M)_{g\cdot p}.
\end{align*}
Also, the action is symplectic, so $L_g^*\theta=\theta$. Therefore
\begin{align*}
\theta_{g\cdot p}((\xi_M)_{g\cdot p},d(L_g)_p v)=\theta_p((\operatorname{Ad}_{g^{-1}}\xi)_M)_p,v).
\end{align*}
Substituting this equality into the expression for $dF_{g,\xi}|_p(v)$ gives
\begin{align*}
dF_{g,\xi}|_p(v)=0.
\end{align*}
Thus $dF_{g,\xi}=0$ on $M$. A smooth real-valued function with zero differential on a connected manifold is constant, since its restriction to every smooth path has derivative zero, and connected manifolds are path-connected on each [connected component](/page/Connected%20Component). Since $M$ is connected, $F_{g,\xi}$ is constant. Because $\xi\in\mathfrak g$ was arbitrary, the whole covector $\mu(g\cdot p)-g\cdot\mu(p)$ is independent of $p$.
[/guided]
[/step]
[step:Derive the group cocycle identity by inserting the intermediate point]
Let $g,h\in G$ and choose any $p\in M$. Using the definition of $c$ and the independence of the point just proved,
\begin{align*}
c(gh)=\mu(gh\cdot p)-gh\cdot\mu(p).
\end{align*}
Insert and subtract $g\cdot\mu(h\cdot p)$:
\begin{align*}
c(gh)=\bigl(\mu(g\cdot(h\cdot p))-g\cdot\mu(h\cdot p)\bigr)+g\cdot\bigl(\mu(h\cdot p)-h\cdot\mu(p)\bigr).
\end{align*}
The first parenthesis is $c(g)$, evaluated at the point $h\cdot p$, and the second parenthesis is $g\cdot c(h)$. Therefore
\begin{align*}
c(gh)=c(g)+g\cdot c(h).
\end{align*}
[/step]
[step:Identify the infinitesimal defect with the displayed two form]
Define
\begin{align*}
b:\mathfrak g&\to\mathfrak g^*
\end{align*}
by
\begin{align*}
b(\eta)=\left.\frac{d}{dt}\right|_{t=0}c(\exp(t\eta)).
\end{align*}
For $\xi,\eta\in\mathfrak g$ and $p\in M$, the definition of $c$ gives
\begin{align*}
c(\exp(t\eta))(\xi)=\mu^\xi(\exp(t\eta)\cdot p)-\mu(p)(\operatorname{Ad}_{\exp(-t\eta)}\xi).
\end{align*}
Differentiating at $t=0$, the first term gives
\begin{align*}
\left.\frac{d}{dt}\right|_{t=0}\mu^\xi(\exp(t\eta)\cdot p)=d\mu^\xi|_p((\eta_M)_p)=\theta_p((\xi_M)_p,(\eta_M)_p).
\end{align*}
For the second term, since
\begin{align*}
\left.\frac{d}{dt}\right|_{t=0}\operatorname{Ad}_{\exp(-t\eta)}\xi=-[\eta,\xi]=[\xi,\eta],
\end{align*}
we obtain
\begin{align*}
\left.\frac{d}{dt}\right|_{t=0}\mu(p)(\operatorname{Ad}_{\exp(-t\eta)}\xi)=\mu(p)([\xi,\eta]).
\end{align*}
Therefore
\begin{align*}
b(\eta)(\xi)=\theta_p((\xi_M)_p,(\eta_M)_p)-\mu(p)([\xi,\eta]).
\end{align*}
This is exactly $\sigma(\xi,\eta)$. Since $b(\eta)$ is independent of $p$, the right-hand side is independent of $p$.
The skew-symmetry follows from the skew-symmetry of $\theta$ and the Lie bracket:
\begin{align*}
\sigma(\eta,\xi)=\theta_p((\eta_M)_p,(\xi_M)_p)-\mu(p)([\eta,\xi])=-\sigma(\xi,\eta).
\end{align*}
Thus $\sigma$ is an alternating bilinear map $\mathfrak g\times\mathfrak g\to\mathbb R$.
[/step]
[step:Differentiate the group cocycle identity to obtain the Lie algebra cocycle condition]
The group cocycle identity implies the infinitesimal identity
\begin{align*}
b([\xi,\eta])=\operatorname{ad}_\xi^*b(\eta)-\operatorname{ad}_\eta^*b(\xi)
\end{align*}
for every $\xi,\eta\in\mathfrak g$, where
\begin{align*}
(\operatorname{ad}_\xi^*\alpha)(\zeta)=-\alpha([\xi,\zeta])
\end{align*}
for $\alpha\in\mathfrak g^*$ and $\zeta\in\mathfrak g$. Indeed, this identity is obtained by differentiating the group cocycle identity
\begin{align*}
c(gh)=c(g)+g\cdot c(h)
\end{align*}
first in the $h=\exp(s\eta)$ direction and then in the $g=\exp(t\xi)$ direction, and antisymmetrising in $\xi$ and $\eta$.
Pairing this identity with $\zeta\in\mathfrak g$ and using $\sigma(\xi,\eta)=b(\eta)(\xi)$ gives precisely the Chevalley-Eilenberg cocycle equation
\begin{align*}
(d\sigma)(\xi,\eta,\zeta)=0
\end{align*}
for real coefficients carrying the zero $\mathfrak g$-action. Hence $\sigma$ is a Lie algebra $2$-cocycle.
[/step]
[step:Compute how adding a constant changes the obstruction cocycle]
Let $a\in\mathfrak g^*$ and define a shifted moment map
\begin{align*}
\mu_a:M&\to\mathfrak g^*
\end{align*}
by
\begin{align*}
\mu_a(p)=\mu(p)+a.
\end{align*}
Since $a$ is constant, $d(\mu_a^\xi)=d\mu^\xi$ for every $\xi\in\mathfrak g$, so $\mu_a$ is again a moment map for the same Hamiltonian action.
Define the equivariance defect $c_a:G\to\mathfrak g^*$ of $\mu_a$ by
\begin{align*}
c_a(g)=\mu_a(g\cdot p)-g\cdot\mu_a(p)=c(g)+a-g\cdot a.
\end{align*}
Define its infinitesimal defect $b_a:\mathfrak g\to\mathfrak g^*$ by
\begin{align*}
b_a(\eta)=\left.\frac{d}{dt}\right|_{t=0}c_a(\exp(t\eta)).
\end{align*}
The corresponding scalar infinitesimal cocycle is
\begin{align*}
\sigma_a(\xi,\eta)=\theta_p((\xi_M)_p,(\eta_M)_p)-\mu_a(p)([\xi,\eta]).
\end{align*}
Therefore
\begin{align*}
\sigma_a(\xi,\eta)=\sigma(\xi,\eta)-a([\xi,\eta]).
\end{align*}
With the Chevalley-Eilenberg convention
\begin{align*}
(d\ell)(\xi,\eta)=-\ell([\xi,\eta]),
\end{align*}
this says
\begin{align*}
\sigma_a=\sigma+d a.
\end{align*}
[/step]
[step:Conclude that equivariance after a constant shift is equivalent to exactness of the cocycle]
Suppose first that there exists $a\in\mathfrak g^*$ such that $\mu_a=\mu+a$ is $G$-equivariant. Then $c_a(g)=0$ for every $g\in G$, so its infinitesimal cocycle satisfies $\sigma_a=0$. From the previous step,
\begin{align*}
0=\sigma+d a.
\end{align*}
Thus $\sigma=d(-a)$, so $\sigma$ is a Chevalley-Eilenberg coboundary.
Conversely, suppose $\sigma$ is a coboundary. Then there exists $\ell\in\mathfrak g^*$ such that
\begin{align*}
\sigma=d\ell.
\end{align*}
Set $a=-\ell$ and define $\mu_a=\mu+a$. The previous step gives
\begin{align*}
\sigma_a=\sigma+d a=d\ell-d\ell=0.
\end{align*}
Since $\sigma_a(\xi,\eta)=b_a(\eta)(\xi)$ for all $\xi,\eta\in\mathfrak g$, this implies $b_a=0$.
It remains to pass from infinitesimal equivariance to group equivariance. The shifted defect $c_a:G\to\mathfrak g^*$ still satisfies
\begin{align*}
c_a(gh)=c_a(g)+g\cdot c_a(h).
\end{align*}
For $g\in G$ and $\xi\in\mathfrak g$, differentiating
\begin{align*}
c_a(g\exp(t\xi))=c_a(g)+g\cdot c_a(\exp(t\xi))
\end{align*}
at $t=0$ gives
\begin{align*}
d(c_a)|_g\left(\left.\frac{d}{dt}\right|_{t=0}g\exp(t\xi)\right)=g\cdot b_a(\xi)=0.
\end{align*}
Thus $dc_a=0$ on $G$. Since $G$ is connected, $c_a$ is constant. Also $c_a(e)=0$, so $c_a(g)=0$ for every $g\in G$. Hence $\mu_a$ is $G$-equivariant.
Therefore the moment map can be made equivariant by adding a constant element of $\mathfrak g^*$ exactly when the Lie algebra $2$-cocycle $\sigma$ is a Chevalley-Eilenberg coboundary.
[/step]