If the group is not abelian, the expression $$\prod_{g\in G} g$$ makes no sense. (It makes no sense at all if the group is infinite, but I assume that it isn't...)
Indeed, take any elements $x,y\in G$ such that $xy\
eq yx$ and call the other elements $$g_1,g_2,\ldots,g_r$$ Then, $$g_1g_2\cdots g_rxy\
eq g_1g_2\cdots g_ryx$$ so the product of the elements of $G$ depends on the chosen order.
So I think that there are two possibilities: perhaps you must assume that the prod expression makes sense, and you must show that, then, the group must be abelian (as I have just done), or the problem is wrongly set out.