Trouble with definition of signature of a compact manifold The signature of a manifold, as I understand it, is defined as follows:
Given a connected, compact, and oriented manifold $M$ of dimension $4n$, we may define a quadratic form on the cohomology group $H^{2n}(M; \mathbb{Z})$ as follows. If we take two cochains $\alpha, \beta \in H^{2n}(M; \mathbb{Z})$, then the cup product $\alpha \smile \beta$ lies in $H^{4n}(M; \mathbb{Z})$. By Poincaré duality, we have an isomorphism $H^{4n}(M; \mathbb{Z}) \simeq H_0(M; \mathbb{Z}) = \mathbb{Z}$ (since $M$ is connected). Using this identification, we may define a "bilinear" (I put this in quotation marks because the cohomology groups are no vector fields) map $\sigma: H^{2n}(M; \mathbb{Z}) \times H^{2n}(M; \mathbb{Z}) \to \mathbb{Z}$. Moreover, since $\alpha \smile \beta = (-1)^{4n^2}\beta \smile \alpha$, $\sigma$ is also symmetric. Thus, we have a symmetric, "bilinear" form. The signature of $M$, denoted by $\sigma(M)$, is then defined as the signature of this form.
I'm confused because the signature of a quadratic or symmetric bilinear form is supposed to be an ordered triple, whereas $\sigma(M)$ is supposed to be an integer. On top of this, I'm not sure how we can consider this a quadratic form since we are not working over a vector space. How am I supposed to define this thing?
 A: You are perfectly right that the bilinear form $\sigma: H^{2n}(M; \mathbb{Z}) \times H^{2n}(M; \mathbb{Z}) \to \mathbb{Z}$ is defined on the $\mathbb Z$-module $H^{2n}(M; \mathbb{Z})$,  which is certainly not a vector space nor even a free abelian group.
And symmetric bilinear forms on $\mathbb Z$-modules are a notoriously difficult subject where nothing so simple as Sylvester's theorem holds.
To  solve the difficulty we should consider 
the bilinear form $\Sigma:  H^{2n}(M; \mathbb R ) \times H^{2n}(M; \mathbb{R}) \to \mathbb{R}$ .
That bilinear form is non degenerate and has $b^+$ positive eigenvalues and $b^-$ negative ones.
We can thus  define the signature (or index, introduced by Hermann Weyl in 1924: see here) $$\operatorname {sign}(M):=\operatorname {sign}(\Sigma)=b^+-b^-.$$ A very nice feature of working with real coefficients is that De Rham cohomology can be used and the cup product can be realized as $$\Sigma ([\omega],[\eta])=\int _M\omega\wedge\eta\in \mathbb R \quad \operatorname {for closed forms } \;\omega,\eta \in \Omega^{2n}(M) .$$ 
Examples
To give a feel for the notion of signature let me give  a few results:
$\bullet \operatorname {sign}(S^4)=0$
$\bullet \operatorname {sign}(S^2\times S^2)=0$
$\bullet \operatorname {sign}(\mathbb P^{2k}(\mathbb C))=1$
$\bullet \operatorname {sign}(M_d)=\frac{4d-d^3}{3}$ for a smooth algebraic surface $M_d\subset \mathbb P^3(\mathbb C)$ (of  real dimension 4) 
$\bullet \operatorname {sign}(M_1\times M_2)=\operatorname {sign}(M_1)\operatorname {sign}(M_2)$ 
Reference
For concrete computations nothing beats the handout of our (alas, too rarely seen here) friend @Liviu Nicolaescu .
