The explicit formula for cup product on group cohomology is as simple as can be. For simplicity let's consider integer coefficients H^{*}(G;Z), although this works for any coefficients as long as they're untwisted.

Let's define group cohomology using inhomogeneous cochains; thus we take the abelian groups C^{n}(G;Z) := functions from G^{n} to Z, endowed with a differential d: C^{n} -> C^{n+1}, and then H^{n}(G;Z) is the usual cohomology ker d_{n}/im d__{n-1}.

Anyway, cup product is a map from H^{k}(G) tensor H^{m}(G) to H^{k+m}(G), and it comes from a map C^{k}(G) tensor C^{m}(G) to C^{k+m}(G). Namely, given two cochains f: G^{n} -> Z and g: G^{m} -> Z, define

f/\g: G^{k+m} -> Z

by

f/\g(x_{1},...x_{k+m}) = f(x_{1},...x_{k})g(x_{k+1},...x_{k+m})

You can check by hand that the differential interacts with this operation by

d(f/\g) = df/\g + (-1)^{k} f/\dg

Thus this "wedge product" of cochains descends to a product on group cohomology, and this is exactly cup product. This is also how cup product is defined for de Rham cohomology; differential forms have a natural wedge product which satisfies d(f/\g) = df/\g + (-1)^{k} f/\dg, and so this induces the cup product on H^{*}(M;R).

Topologically, cup product is the composition of

H^{k}(Y) tensor H^{m}(Y) -> H^{k+m}(Y x Y) -> H^{k+m}(Y)

where the first map is the Kunneth map (just pullback by the two projections Y x Y -> Y), and the second map is restriction to the diagonal. Applying this perspective to group cohomology, we would first define f x g : (GxG)^{k+m} -> Z by

f x g ((x_{1},y_{1}),...(x_{k+m},y_{k+m})) = f(x_{1},...x_{k})g(y_{k+1},...,y_{k+m}).

Upon restriction to the diagonal G < G x G, f x g restricts to f /\ g above.