I often hear people saying that (co)homology is really useful in many areas of mathematics.
In which way is (co)homology used in different areas of mathematics to prove theorems?
I only know one example: the proof of Brouwer's fixed point theorem uses homology: every continuous function $f\colon D^n\to D^n$ has a fixed point, where $D^n$ is the $n$-disk. Suppose not. Then construct a continuous map $h\colon D^n\to S^{n-1}$ by sending each $x\in D^n$ to the intersection of the line connecting $x$ and $f(x)$ with the boundary $S^{n-1}$ of $D^n$. Now, note that $h$ has a right inverse, given by the inclusion $$i\colon S^{n-1}\to D^n, \, x\mapsto x,$$ that is, $$h\circ i=\mathrm{id}_{S^{n-1}}.$$ Then, by the functoriality of the homology functor $H_{n-1}\colon \mathbf{Top}\to\mathbf{Ab}$, it follows that $$H_{n-1}(h)\circ H_{n-1}(i)=\mathrm{id}_{H_{n-1}(S^{n-1})},$$ which implies that $H_{n-1}(h)\colon H_{n-1}(D^n)\to H_{n-1}(S^{n-1})$ has a right inverse (in particular is surjective). But this can't be possible, since $H_{n-1}(D^n)$ is the trivial group, whereas $H_{n-1}(S^{n-1})$ is infinite.
So using homology, every property of the category $\mathbf{Top}$ (e.g., whether a certain morphism has a left inverse) gets translated into a property of the category $\mathbf{Ab}$ (and, by contraposition, if a property isn't true in $\mathbf{Ab}$, then it can't be true in $\mathbf{Top}$).
Has every use of (co)homology the form of the above argument, i.e., uses that properties of the category $\mathbf{Top}$ get translated into a property of the category $\mathbf{Ab}$?
I would think no, because I doubt that interesting properties can always be formulated as categorical properties.
But then, can (co)homology be used in another way? For instance, I heard that cohomology was used in the proof of the Weil conjectures, and I also heard that there's a cohomology theory (Group cohomology) which can be used in group theory. This seems crazy. I just want to get a clue at why (co)homology is useful in these areas and how it is applied there.