What is (co)homology, and how does a beginner gain intuition about it?
I think the most intuitive way to look at topology is as a way to make precise the following idea. A warning: the idea by itself does not define homology, but something much scarier. Homology is what you get when you give up studying the scary but intuitive thing, and try to get something similar, but which you can calculate.
Consider a manifold. Homology is meant to count its submanifolds, up to cobordism. In other words, as out "chains of dimension $n$", take the formal sums of submanifolds of dimension $n$, where the submanifolds might have boundary. The boundary operation $\partial$ just takes the boundary. Notice that the boundary of any manifold is a manifold without boundary, so it's clear that $\partial^2=0$.
Now, the homology of this chain complex counts submanifolds without boundary; two submanifolds are considered different if they are not boundaries of the same higher-dimensional submanifold. If you think of the higher-dimensional submanifolds as a way to "move" one of the submanifolds to another, it makes sense that you might want to think of them as the "same". If a submanifold does not surround a "hole", it is the "same" as the "empty submanifold", this is a sense in which this homology counts holes.
Again, if you try to make this precise, you will run into all kinds of trouble. You'll have to define what a "submanifold" is, whether they can have self-intersections, etc. Then, you'll find that the above kind of "homology" is not really a homotopy invariant, and terribly difficult to calculate.
However, you should compare the above idea to the definition of simplicial homology. You'll see that the cycles you get in simplicial homology are similar to submanifolds, and all the wonderful algebraic machinery will show you that you can actually calculate homology of anything you'd like.
One algebraic topology book that seems to have this approach in it is Bredon's "Topology and Geometry".
The above intuition is especially useful in differential topology. There is a way to make the above idea (called cobordism theory), but you need to know how to use homology to do it. For a taste of it (that doesn't require homology), look in the last chapter of Milnor's "Topology from the Differential Viewpoint".
Three unrelated comments:
Never expect any intuition from singular (co)homology, and never calculate anything with it; it is merely a tool for showing that other kinds of homology (that you actually care about) are the same and invariant under homotopy.
A completely different (and very precise) way to intuitively think of cohomology is as solutions to a certain differential equation. This is the approach of the "Calculus to Cohomology" book and Bott and Tu's "Differential Forms in Algebraic Topology", and is called De Rham cohomology.
Don't be surprised if there are some mistakes in any of the above; wise people - feel free to point them out and clarify!
Most of these links aim to give some geometric intuition for what homology does, so I'll try to briefly explain the algebraic intuition in case that's also useful.
A very common operation in algebra (e.g. algebraic combinatorics, representation theory) is to study a set by considering the free abelian group (or free k-vector space) on that set. Many sorts of questions are easier to answer in the linearized setting. Homology is basically the extension of this operation from sets to spaces. In fact, one can define the homology groups of a space as the homotopy groups of its infinite symmetric product (= free topological abelian monoid on the (pointed) space). If we work with simplicial sets rather than spaces, we see the connection to chain complexes. From a simplicial set we can form a simplicial abelian group by applying the free abelian group functor levelwise. The category of simplicial abelian groups turns out to be equivalent to the category of chain complexes of abelian groups, and the chain complex we get out is exactly the usual "simplicial chain complex" computing simplicial homology. If we started with the singular complex of a topological space, we would get out the singular chain complex of that space.
This doesn't explain why H_n measures n-dimensional "holes" in a space, but hopefully it explains somewhat why homology is important and easier to compute than homotopy (because of the "linearization" process).
On page 2 of this paper, while discussing Euclid's axioms of plane geometry and spatial geometry, Manin makes an extremely interesting (for me, anyway) comment:
Euclid misses a great opportunity here: if he stated the principle
“The extremity of an extremity is empty”,
he could be considered as the discoverer of the
BASIC EQUATION OF HOMOLOGICAL ALGEBRA: d^2 = 0.
(I've just posted a new question expanding on this.)
Now let me say a few things that are more concrete and less philosophical. The boundary operator in simplicial homology should be pretty intuitive, except for the signs. Where do the signs come from? The signs come in because, for example, we want to make sure that when we take the boundary of (say) a square, we get the same answer (namely the 4 outer edges of the square) no matter how we triangulate it. If we didn't have the signs, then different ways of triangulating the square would lead to different answers, in particular wrong answers (namely something other than the 4 outer edges of the square).
Another question might be, why simplices in the first place? Why not, say, cubes? One reason is because polygons (resp. higher-dimensional analogues) can always be chopped up into finitely many triangles (resp. higher-dimensional analogues), but they can't always be chopped up into (finitely many) squares. However, there is actually a version of homology which uses cubes instead of simplices, appropriately called cubical homology. I think the theory all works out and gives you something equivalent to simplicial homology, but it is in many ways not as nice. Though it is nicer in some ways, for example, a product of simplices is not a simplex, but a product of cubes is a cube, which makes certain proofs easier.