Suppose that $G$ is finite cyclic of order $n$ and $\sigma$ is a generator. Consider the elements $\sigma' = 1-\sigma$ and $\eta = 1+\sigma+\cdots+\sigma^{n-1}$, which induce maps $\mathbb ZG\to\mathbb ZG$ by multiplication. Note (or prove) that
$\ker(\sigma'\cdot -) = \text{im}(\eta\cdot -)$
$\text{im}(\sigma'\cdot -) = \ker(\eta\cdot -)$.
$\text{coker}(\sigma')$ is the trivial $\mathbb ZG$-module $\mathbb Z$.
All this means the following is a free resolution of the trivial $\mathbb ZG$-module $\mathbb Z$:
$$\mathcal Q:\cdots\longrightarrow\mathbb ZG\stackrel{\eta}\longrightarrow \mathbb ZG \stackrel{\sigma'}\longrightarrow \mathbb ZG\stackrel{\eta}\longrightarrow \mathbb ZG\stackrel{\sigma'}\longrightarrow \mathbb ZG $$
This gives what you want, and in fact a complete description of all cohomology groups $H^p(M,G)$.
Add To see how the above helps with your question, note that taking $\hom_G(-,M)$ against the portion of the resolution $\mathbb Z G\stackrel{\eta}\to\mathbb Z G\stackrel{1-\sigma}\to \mathbb ZG$ and identifying $\hom_G(G,M)=M$ you get that $H^2(G,M)$ is isomorphic to
the homology of
$$M\stackrel{\eta}\to M\stackrel{1-\sigma}\to M$$
at the middle. The kernel of $1-\sigma$ is certainly $M^G$, and $\eta$ is precisely your trace map. To solve your problem about $2$-cocycles, you want to find a comparison map from $\mathcal Q$ to the usual resolution you use to compute group homology. These maps will tell you exactly what $f$ to choose to make $f-f_m$ a boundary.