How can I understand cohomology theories in the context of basic homology theory? Please pardon the ignorance in advance -- I'm doing research, trying to solve a specific problem, so naturally I'm led down paths in mathematics I never had the opportunity to study in depth.
I understand the basic ideas of topology, and algebraic topology. For example, I understand the intuitive interpretation of $\pi_0(X)$ as the free group on $k$ letters, where $X$ has $k$ "holes" in it... and so on in higher dimensions to get all the homotopy groups. I then think of homology as the abelianization of those homotopy groups. This all makes sense intuitively.
The reason I think I need to understand cohomology is because it sounds like it provides a means of assigning a notion of "quantity" or "value" to the elements of a given space. In particular, I'm going to be looking at the clique complex of a weighted graph, so there are many interesting "quantities" to look at.
What I don't get is how this cohomology business actually works to get me there, and what I need to learn to finish off this problem.
Now, it's my understanding that cohomology is the "algebraic dualization" of the concept of homology. And I sorta get that, and I've read how one can literally turn a chain complex into a cochain complex trivially.
I also have noticed that, while there are an abundance of "cohomology theories," there is only one notion of "homology" I've come across.
If someone could help me put all this together in my head I would be super appreciative! And given knowledge of my use case, any hints on whether I'm off on the wrong tangent would be really helpful as well.
TIA!!
 A: First, I think you mean $\pi_1(X)$ in your second paragraph. What you describe is only true for $\mathbb{R}^2$ (and homeomorphic spaces), basically: it is true that the fundamental group of $\mathbb{R}^2$ with $k$ points removed ("holes") is the free group on $k$ letter. But for other spaces that's not the case anymore... For example if you remove a point from $\mathbb{R}^n$ you get a space homotopy equivalent to $S^{n-1}$, and if $n \ge 2$ this space has a trivial fundamental group...
I think the "best" intuition you can get here is from the definition, IMO: you're looking at loops based at a point, and you identify homotopic loops. You can't go wrong if you look at the $\pi_1$ in this way. In general thinking about it in terms of "holes" and whatnot can be useful in some cases, but can also lead to errors in other cases.

Now, homology is not the abelianization of the homotopy groups! You're probably thinking of the Hurewicz theorem. It states that yes, if the space is connected then $H_1 = \pi_1^{ab}$. Similarly if $\pi_0 = \pi_1 = \dots = \pi_{n-1} = 0$, then $H_n = \pi_n^{ab}$. But now you should think something is fishy. Indeed, the higher homotopy groups, $\pi_{n \ge 2}$, are always abelian! So homology wouldn't be very interesting if it were just the abelianization of the homotopy groups. The theorem only holds true for the first nonzero homotopy group, after that all bets are off.
Let's look at two examples.


*

*The spheres have very simply homology:
$$H_i(S^n) = \begin{cases}
0 & i \neq 0 \text{ and } i \neq n \\
\mathbb{Z} & i = 0 \text{ or } i = n
\end{cases}$$
You might expect the homotopy groups to behave simply too, if after all homology is just the abelianization of homotopy... As it turns out, computing the homotopy groups of spheres is an open problem! You can look at a table for small values here. There are no readily apparent patterns besides the suspension isomorphism, if you don't know what to look for. (Well, there are actually some patterns, but the fact that these patterns exist are big theorems from homotopy theory...)

*The Eilenberg–MacLane spaces have very simple homotopy. For a given abelian group $A$:
$$\pi_i(K(A,n)) = \begin{cases}
0 & i \neq 0 \text{ and } i \neq n \\
A & i = 0 \text{ or } i = n
\end{cases}$$
Once again you might expect their homology to be simple. And once again that's not the case. For example $K(\mathbb{Z}, 2) = \mathbb{CP}^\infty$ is the infinite-dimensional complex projective space, and its homology has infinitely many nontrivial parts!



There is such a thing as a "homology theory". The axioms are very similar to the axioms for a cohomology theory, except the arrows are reversed. In fact, every cohomology theory yields what is called a "spectrum" (don't worry if you don't know what that is), and every spectrum has an associated homology theory. So for example singular cohomology corresponds to singular homology, K-theory corresponds to K-homology, etc.

As for the overall question, the goal of homotopy/homology/cohomology is to assign "invariants" to topological spaces. Spaces are complicated beasts, and we can't really hope to understand them as it is. So we build what are called "invariants" to try to understand parts of it in order to try to understand the big picture.
Maybe this analogy will be helpful: imagine you've got an object that you know nothing about. You can look at it with your eyes, you can take an X-ray of it, you can smell it, you can touch it and see how it feels... And all this starts to form a coherent picture and you can know a lot of things about the object in this way. That's more or less what we're doing here: look at an object from all sorts of point of views to try to understand it better. And since it's difficult to smell what a sphere is, people invented mathematical constructions to try to understand them.
As for a more mathematical motivation for (co)homology and the specific aspects of the space they represent, I can refer you to:


*

*Motivating Cohomology

*Intuition of the meaning of homology groups
A possible way to look at cohomology is that you take a cell complex (for example), and you look at functions that assign elements of a given group to these cells. AFAIK it takes its roots in obstruction theory: you have a given map $f$ on the $k$-skeleton, and you want to extend it to the $(k+1)$-skeleton. The map $f$ naturally assigns elements of $\pi_k$ to each $(k+1)$-cell, and it gives you a cocycle. This is the very rough beginning of the construction of the Serre spectral sequence. Looking at things like Poincaré duality could be helpful if you want to understand cohomology and you already know homology.
