How do I know when a form represents an integral cohomology class? Suppose $M$ is an $n$-dimensional manifold, and $\omega \in \Omega^p(M)$ is a closed $p$-form. Moreover, assume that $d\omega = 0$, so that it represents a de Rham cohomology class.
I would like to understand the meaning of the following sentence that I read in a book about geometric quantisation: $\omega$ represents an integral cohomology class.
Here's what I thought: we have the Poincaré isomorphism $\Phi : H_{dR}^p(M) \rightarrow {H_p}(M, \mathbb{R})^*$, where:
$$H_{dR}^p(M) = \text{$p$th de Rham cohomology group;}$$
$${H_p}(M, \mathbb{R}) = \text{$p$th differentiable singular homology group;}$$
and the star denotes the dual. This isomorphism is given by integration of the given form over the corresponding $p$-cycle.
Now, since we have a natural inclusion ${H_p}(M, \mathbb{Z}) \subseteq {H_p}(M, \mathbb{R})$, I could say that $\omega \in \Omega^p(M)$ represents an integral cohomology class when $\Phi(\omega) \in {H_p}(M, \mathbb{Z})$. But this is basically saying that the integral of $\omega$ over any differentiable $p$-cycle is an integer. Surely this cannot hold, except for trivial cases. So what does it mean to represent an integral cohomology class?
I would also like to know: when does the volume form of a closed manifold represents an integral cohomology class, and why?
Thank you.
 A: With regard to your last question, you're on a good path for examples. Following @Qiaochu's first example, we have the closed $2$-form $\omega$ that generates $H^2(\mathbb R^3-\{0\}) \cong H^2(S^2)$:
$$\omega = \frac{x\,dy\wedge dz + y\, dz\wedge dx + z\, dx\wedge dy}{(x^2+y^2+z^2)^{3/2}}\,.$$
This should look familiar if you interpret it as the flux $2$-form of the gravitational or electric force with a particle at the origin and think of Gauss's Law. As it stands, this $2$-form is not integral, as the integral over any closed surface containing the origin, say, the unit sphere, is $4\pi$. But we can normalize and get an integral class: $\frac1{4\pi}\omega$ is now the generator of $H^2(S^2,\mathbb Z)$.
You can make this work analogously by normalizing "the" volume form for any compact, orientable $n$-manifold.
However, one of @Qiaochu's statements is wrong. If we take $M=S^2(1)\times S^2(\pi)$ (where by these numbers I mean radii), then the element of $H^2(M)$ that corresponds to the sum of the respective area forms (officially, pulled back by the canonical projections) is not an integral class, and no scalar multiple of it is (because $H^2(M)\cong \mathbb R\oplus\mathbb R$).
A: On $M = \mathbb{R}^2 \setminus \{ (0, 0) \}$ consider the differential form
$$\omega = \frac{1}{2\pi} \frac{x \, dy - y \, dx}{x^2 + y^2}.$$
This is a closed $1$-form. Its integral over a path in $M$ is its winding number; in particular, it is always an integer. 
For nontrivial examples of integral $2$-forms you just need to find examples of nontrivial complex line bundles. More precisely, any such form is the curvature form of a connection on a complex line bundle $L$, and the corresponding integral cohomology class is the first Chern class $c_1(L)$ of $L$. This is a special case of Chern-Weil theory. This example comes up in physics when discussing Dirac's quantization argument; see, for example, this paper by Bott. 
