TITLE: Coboundaries and Gluing in Cech Cohomology - Intuition?
QUESTION [13 upvotes]: I'm trying to develop an intuition for Cech cohomology geometrically, but am currently failing. A lot of people seem to say that the groups $H^n$ measure obstructions to gluing local sections to get global ones. However I don't see how this works, and I think it's because I don't understand coboundaries.
I see that $H^0$ is the group of global sections. Moreover $B^1\setminus 0$ tells us all the 1-cochains arising from the failure of 0-cochains to glue to give global sections. This suggests to me that we might want to study $B^1$, but instead we quotient by it to get $H^1$. Why?
I know that $Z^1$ tells us all the 1-cochains that agree on overlaps, and obviously $B^1$ is a subset of $Z^1$. But I don't know what $Z^1$ modulo $B^1$ is meant to tell me. I especially don't see how it has anything to do with gluing things. As far as I can tell it just informs me about the consistent 1-cochains which don't have anything to do with the failure to glue 0-cochains together. What am I missing?
Edit: it has just occurred to me that maybe the thing I don't understand is the meaning of gluing here. If I have the wrong idea about that could somebody please explain what is meant by it? Many thanks!

REPLY [6 votes]: Regarding higher cohomology, I was about to write another comment, but the comments are getting a bit long, so let say a few words here. Cech theory is really a generalization of simplicial cohomology, as Liviu explained, and this is really the best way to understand where the formulas come from. But if you find that unhelpful, let me work out a basic  example.
Suppose $X$ is a $C^\infty$ or complex manifold, and let $\mathcal{O}_X$ denote either the sheaf of complex valued $C^\infty$ functions or holomorphic functions. A complex line bundle
is a manifold $L$ of the same  type with a map $L\to X$ which makes it locally a product.
In other words we have isomorphisms $\sigma_i:\mathbb{C}\times U_i\cong L|_{U_i}$. The first components of $\sigma_i^{-1}\sigma_j$ gives a Cech $1$-cocycle of $g_{ij}\in \mathcal{O}^*(U_{ij})$. If you wish to eliminate the choice of trivialization ($\sigma_i$), you need to work  with cohomology class. 
The basic topological invariant of $L$ is its first Chern class
$c_1(L)\in H^2(X,\mathbb{Z})$ which measure the failure of $L$ to be (topologically) a product. The first question is what does $H^2$ mean? The second is what is $c_1$? For 1, you can triangulate $X$, and use simplicial cohomology, or you can use Cech cohomology. The fact that the formulas are similar, means that the group may be similar. In fact, they are the same. For 2, we note that in the $C^\infty$ case, $H^1(X,\mathcal{O}_X)=0$. We can attempt
lift back to this trivial group by taking the normalized logarithm
$\frac{1}{2\pi \sqrt{-1}}\log g_{ij}$. However, because the logarithm is "multvalued", there is no guarantee that this is a cocycle. So take the Cech boundary to get
$$c_1(L) = \frac{1}{2\pi \sqrt{-1}}(\log g_{ij}+\log g_{jk}+\log g_{ki})$$
When the cohomology class defined by this vanishes, then $L$ is topologically trivial.