I'm fairly new to topology, and so far I've understood cohomology via cochains. 


First we build an object called a cochain ($C^n$), then define a differential map that takes you from $C^n$ to $C^{n+1}$. Then all the types of cohomology groups I've encountered can be easily defined as:
\begin{equation}
H^n(M) = Z^n / B^n
\end{equation}
Where $Z^n$ is the n-cocyle and $B^n$ is the n-coboundary.


The trouble I'm facing is in defining the map $\partial^n: C^n \rightarrow C^{n+1}$


In other cohomologies, the map has an intuitive explanation. For example, in deRham cohomology, the map just sends a differential form to a higher differential form, but due to Stokes' theorem we can interpret the nth form being the boundary of an n+1th form. In simplical homology, we define the map to be the boundary of the n-chain, so a line segment will have the two endpoints as its boundary etc.


In group cohomology however, the map is defined as: $f:G^n \rightarrow A$ where A is a G module, and:
\begin{equation}
\partial^i f(g\_0,\cdots,g\_i) = g\_o f(g\_1,\cdots,g\_i) + \sum\_{j = 1}^i (-1)^j f(g\_0,\cdots, g\_{j-1} g\_{j}, g\_{j+1}, \cdots, g\_i) + (-1)^{i+1} f(g\_0,\cdots, g\_{i-1})
\end{equation} 


Now I understand that you can prove the various "standard" properties of this map using this definition (like $\partial^{i+1} \partial^i f = 0 $ etc.), but what is the intuitive explanation for what's going on? Why is this map defined the way it is? How does this correspond to the boundary interpretation of other types of cohomologies? How can I "see" it being a boundary without explicitly computing $\partial^2 = 0$? 


And what happens when the groups are continuous? For lie groups can we apply deRham cohomology? What about cohomology on principal G-bundles? Any introductory resources on this subject would be much appreciated!



An intuitive explanation for group cohomology via cochains?
What I'm going to say is pretty much the same that JK34 has written in their answer, but in a more elementary approach that is hopefully adding some insight. 


Suppose that you want to look at the "shape" of a group $G$. That is, let's construct a space that "looks like $G$". For simplicity suppose that $G$ is finite or finitely presented.
The idea is as follows: draw a point, call it $\*$. Now for each element $g$ of $G$, draw a loop based at $\*$, that is, a closed path from $\*$ to itself. 


The identity is assigned a "trivial" loop, meaning that it doesn't have any extension, it "stays at the base point" (imagine the trivial loop in algebraic topology). 


Given $g\in G$, also $g^{-1}$ is in $G$. Don't add an extra path for $g^{-1}$, just imagine that your loops can be walked either way.


Now, given $g,h\in G$, clearly $gh$ is in $G$ too, so it has its own arrow. However, this arrow should not be independent of $g$ and $h$, it should be somehow the composition. A way to encode this (at least up to homotopy) is to add a 2-simplex (a filled triangle) between those three arrows (can't draw them here, sorry! Imagine a triangle with vertices all equal to $\*$ and sides $g$, $h$, and $gh$). Do this for every pair of elements of $G$. 


Now composition in the group is associative, that is, $(gh)i=g(hi)$ for each $g,h,i\in G$. Consider the triangles determined by $(g,h)$, $(gh,i)$, $(g,hi)$ and $(h,i)$. Can you see that these triangle form the faces of a tetrahedron? The first two and last two, pairwise glued, should again in some sense be the same, because of associativity. So, fill this tetrahedron too, with a 3-cell. 


...and so on, imagine an $n$-dimensional simplex every time you have a composition of $n-1$ elements.


The resulting space is going to be a simplicial complex, called the [classifying space](https://en.wikipedia.org/wiki/Classifying_space) of $G$, denoted by $BG$ (notation may vary).


Try to prove that



> 
> The classifying space of $\Bbb{Z}$ is the circle. 
> 
> 
> 


(Hint: we have one loop for each element of $G$...). If you understand that, it shouldn't come as a surprise that



> 
> More generally, the fundamental group of $BG$ is $G$
> 
> 
> 


and (can you see why?),



> 
> All higher homotopy groups of $BG$ are trivial.
> 
> 
> 


Now, as we have seen, a 2-simplex (i.e. triangle) in $BG$ is given by a pair $(g,h)$, with $g,h\in G$. What are the faces of that triangle? Those are the sides, which as we have constructed, are $g,h$, and $gh$. So, adding the signs consistently, it makes sense that the boundary of the simplex $(g,h)$ is 
$$
\partial(g,h) = g - gh + h.
$$
This should give you an idea why the coboundary map in group cohomology is defined that way: we have that $(df)(g,h)=f(\partial(g,h))$. 
Can you see what the boundary maps of simplices of degree $3$ will do? And higher?
This should also give you an idea why, in general, 



> 
> The singular cohomology of $BG$ is exactly the group cohomology of $G$.
> 
> 
> 


So, in short: group cohomology is helpful to study groups because it studies the "shape of a group" in the sense of algebraic topology.


