Suppose that $S$ is a compact orientable surface. In this case, the top de Rham cohomology space $H^2(S)\cong \mathbb{R}$, with the isomorphism given by integration on $2$-forms along $S$.


Now, one can define *integral* cohomology classes as those cohomology classes $a$ so that $\int\_S a \in \mathbb{Z}$. On the other hand, one can also define integral cohomology classes as those classes corresponding to integral Cech cohomology classes $\check{H}^2(S,\underline{\mathbb{Z}})$ in the following way:


If $\omega$ is a closed $2$-form, we can find an open cover $\mathfrak{U}$ of $S$ and $1$-forms $\alpha\_U$ on each $U$ so that $\omega|\_U = d\alpha\_U$. Now, choose functions $f\_{UV}$ so that $df\_{UV} = \alpha\_U - \alpha\_V$. The cocycle


$$
f\_{UVW} = f\_{UV} + f\_{VW} - f\_{UW}
$$


satisfies that $df\_{UVW}=0$, so $f\_{UVW} \in \check{H}^2(S,\underline{\mathbb{R}})$.


With this in mind, I claim that $[\omega]$ is integral if and only if one can choose $(\alpha\_U)$ and $(f\_{UV})$ such that $(f\_{UVW}) \in \check{H}^2(S,\underline{\mathbb{Z}})$.


I want to see why these two definitions coincide. More precisely, I would like to see an explicit proof on why, given that $\int\_S \omega \in \mathbb{Z}$, I can choose the $f\_{UV}$ so that $f\_{UVW} \in \mathbb{Z}$. Please, I prefer an explicit proof of this fact, rather than invoking Poincaré Duality/de Rham theorem.



Different definitions for integral de Rham cohomology classes
$\def\RR{\mathbb{R}}\def\ZZ{\mathbb{Z}}$I've considered assigning this when I've taught sheaf cohomology but it always seemed a little too hard. Let's see if I can do it. I'll be a little more general while I am at it and do the case of a smooth compact oriented $n$-fold. Choose a triangulation $S$ of the $n$-fold; let $F\_j$ be the set of $j$-dimensional faces.


For each vertex $u \in F\_0$, let $U(u)$ be the star shaped open neighborhood of $u$ as in the OP's answer. The $U(u)$ give an open cover of $X$. For any $u\_0$, $u\_1$, ..., $u\_j$ in $F\_0$, the intersection $U(u\_0) \cap \cdots \cap U(u\_j)$ is empty if $(u\_0, \dots, u\_j)$ are not the vertices of a face, and this intersection is a contractible open set which I'll call $U(\sigma)$ if $(u\_0, \dots, u\_j)$ are the vertices of a face $\sigma$ in $F\_j$. Thus, the Cech complex of $\underline{\RR}$ is identified with the simplicial cohomology complex
$$\RR^{F\_0} \to \RR^{F\_1} \to \cdots \RR^{F\_{n-1}} \overset{d\_{n-1}}{\longrightarrow} \RR^{F\_n}.$$


For any $n-1$ dimensional face $\tau$, there are two $n$-faces $\sigma\_1$ and $\sigma\_2$ containing $\tau$. Letting $e\_{\tau}$ be the basis function corresponding to $\tau$, we have $d\_{n-1}(e\_{\tau}) = e\_{\sigma\_1} - e\_{\sigma\_2}$. (I am being sloppy about signs, but the fact that we are on an oriented manifold will make it all work out in the end.) So (using that our manifold is connected) the cokernel of $d\_{n-1}$ is clearly $\RR$, and an explicit map from $\RR^{F\_n}$ to the cokernel sends a function $f \in \RR^{F\_n}$ to $\sum\_{\sigma \in F\_n} f(\sigma)$.


Let $\Omega^p$ be the sheaf of smooth $p$-forms, and let $Z^p$ be the subsheaf of closed $p$-forms. Note that $Z^0 = \underline{\RR}$, so we have just computed that $H^n(X, Z^0) \cong \RR$. The Poincare lemma gives short exact sequences $Z^p \to \Omega^p \to Z^{p+1}$ for $0 \leq p \leq n$, so we get boundary maps
$$H^0(X, Z^n) \to H^1(X, Z^{n-1}) \to \cdots \to H^n(X, Z^0) \cong \RR.\quad (\ast)$$
In the case of a surface, the OP has given explicit descriptions of these maps in his answer.


By the usual argument with partitions of unity, $H^q(X, \Omega^p)$ vanishes for $q>0$, so all these maps are isomorphisms except the first one. The first map, in turn, is surjective with kernel $d H^0(X, \Omega^{n-1})$. So the image of the first map is $H^n\_{DR}(X)$, and all the other $H^q(X, Z^{n-q})$ are isomorphic to $H^n\_{DR}(X)$. Our goal, given an $n$-form $\omega$, is to show that the composition of all these maps gives $\int\_X \omega$.


Note that a class in $H^q(X, Z^{n-q})$ is given by a Cech representative $( \eta\_{\sigma} )\_{\sigma \in F\_q}$, where $\eta\_{\sigma}$ is a closed $(n-q)$-form on $U(\sigma)$.


Choose a regular CW subdivision $S^{\perp}$ of $X$ dual to the triangulation. That means the poset of faces of $S^{\perp}$ is dual to that of $S$ and each $j$-face $\sigma$ in $S$ crosses the dual $n-j$ face $\sigma^{\perp}$ transversely in one point. An explicit way to do this is to take the barycentric subdivision of $S$ and draw the "obvious" dual faces. If we choose an ordering of $F\_0$, that gives an orientation to every face $\sigma$ of $F\_q$, and then we can use the global orientation of $X$ to orient $\sigma^{\perp}$.


I claim that the composite isomorphism $(\ast)$ from $H^{q}(X, Z^{n-q})$ sends $(\eta\_{\sigma})\_{\sigma \in F\_q}$ to
$$\sum\_{\sigma \in F\_q} \int\_{\sigma^{\perp}} \eta\_{\sigma}.$$


Let's see what this means for $q=n$. Each $\eta\_{\sigma}$ is a closed $0$-form on $U(\sigma)$. A closed $0$-form is locally constant function and $U(\sigma)$ is connected, so we just have a real number for each $\sigma$ in $F\_n$ and we can thus think of $\eta$ as a vector in $\RR^{F\_n}$. Each $\sigma^{\perp}$ is just a point in the interior of $\sigma$. So we are just summing up the values of $\eta$ on the $n$-faces, and this is the map $\RR^{F\_n} \to \RR$ that we described before.


Let's next see what this means for $q=0$. Each $\eta\_{\sigma}$ is an $n$-form on $\sigma$, and the condition that $(\eta\_{\sigma})$ is a Cech co-cycle says that $\eta\_{\sigma}$ is the restriction of a global $n$-form $\omega$ on $X$. The $n$-faces $\sigma^{\perp}$, for $\sigma \in F\_0$, partition $X$. So
$$\sum\_{\sigma \in F\_q} \int\_{\sigma^{\perp}} \eta\_{\sigma} = \sum\_{\sigma \in F\_q} \int\_{\sigma^{\perp}} \omega|\_{\sigma^{\perp}} = \int\_X \omega.$$


Thus, we just need to show that, if $(\eta\_{\sigma})$ represents a class in $H^q(X, Z^{n-q})$ and $\delta\_q$ is the boundary map $H^q(X, Z^{n-q}) \to H^{q+1}(X, Z^{n-q-1})$, then
$$\sum\_{\sigma \in F\_q} \int\_{\sigma^{\perp}} \eta\_{\sigma} = \sum\_{\tau \in F\_{q+1}} \int\_{\tau^{\perp}} \delta\_q(\eta)\_{\tau}. \quad (\dagger)$$


Whew! Okay, let's remember how the boundary map in sheaf cohomology works. Let $(\eta\_{\sigma})$ be a cocycle for $H^q(X, Z^p)$. Since each $\sigma$ is contractible, we can lift each $\eta\_{\sigma}$ to a $p-1$ form $\theta\_{\sigma}$ with $d(\theta\_{\sigma}) = \eta\_{\sigma}$. Let $\tau$ be a $q+1$ face of our triangulation. Then
$$\delta\_q(\eta)\_{\tau} = \sum\_{\sigma \subset \tau} \pm \theta\_{\sigma},$$ where the sign involves the relative orientation of $\sigma$ and $\tau$.


We want to show $(\dagger)$. Plugging in the above description of the Cech co-boundary, the right hand side is
$$\sum\_{\tau \in F\_{q+1}} \int\_{\tau^{\perp}} \sum\_{\sigma \subset \tau} \pm \theta\_{\sigma}.$$
Pulling the sum out of the integral and switching order of summation, we have
$$\sum\_{\sigma \in F\_q} \sum\_{\tau \supset \sigma} \int\_{\tau^{\perp}} \pm \theta\_{\sigma}.\quad (\heartsuit)$$


Now, the subdivisions $S$ and $S^{\perp}$ are dual, so $\tau \supset \sigma$ if and only if $\sigma^{\perp} \subset \tau^{\perp}$ or, in other words, $\tau^{\perp} \subset \partial(\sigma^{\perp})$. All the signs work out perfectly, so that $(\heartsuit)$ is
$$ \sum\_{\sigma \in F\_q} \int\_{\partial(\sigma^{\perp})} \theta\_{\sigma}.$$
By Stokes' theorem,
$$\int\_{\partial(\sigma^{\perp})} \theta\_{\sigma} = \int\_{\sigma^{\perp}} d(\theta\_{\sigma}) = \int\_{\sigma^{\perp}} \eta\_\sigma.$$
We have now recovered the left hand side of $(\dagger)$.




---


The OP only asked for top cohomology, but I think other cohomological degrees are similar. Once again, we have maps
$$H^0(X, Z^k) \to H^1(X, Z^{k-1}) \to \cdots \to H^k(X, Z^0)$$
giving isomorphisms
$$H^k\_{DR}(X) \cong H^1(X, Z^{k-1}) \cong \cdots \cong H^k(X, Z^0) \cong H^k(X, \RR). \quad (\diamondsuit)$$
We'd like to know that a class $\omega$ in $H^k\_{DR}(X)$ is represented by a class in $H^k(X, \ZZ)$ if and only if $\omega$ pairs to an integer against every integer chain in $H\_k(X, \ZZ)$; it is enough to test against chains coming from the triangulation $S$. Let $c = \sum\_{\rho \in F\_k} c\_{\rho} \rho$ be a $k$-chain. We want to how to pair all the spaces in $(\diamondsuit)$ against $c$. Let $\eta$ be a $q$-cocycle for $Z^{k-q}$. I believe the same argument as before shows that $\langle c, \eta \rangle$ is
$$\sum\_{\sigma \in F\_q} c\_{\rho} \sum\_{\rho \in F\_k} \int\_{\sigma^{\perp} \cap \rho} \eta\_{\sigma}. $$
In particular, if $q=k$, then $\sigma^{\perp} \cap \rho$ is a single point when $\rho = \sigma$ and otherwise $0$. So, viewing the Cech cohomology $H^k(X,\mathbb{R})$ as the cohomology of
$$\RR^{F\_0} \to \RR^{F\_1} \to \cdots \RR^{F\_{n-1}} \overset{d\_{n-1}}{\longrightarrow} \RR^{F\_n}$$
and the simplicial cohomology $H\_k(X, \ZZ)$ as the homology of
$$\ZZ^{F\_0} \leftarrow \ZZ^{F\_1} \leftarrow \cdots \leftarrow \ZZ^{F\_n},$$
the pairing between $H^k(X,\mathbb{R})$ and $H\_k(X, \ZZ)$ is induced by the obvious pairing between $\RR^{F\_k}$ and $\ZZ^{F\_k}$.


We then want to show that, if a cocycle in $\RR^{F\_k}$ pairs integrally against all cycles in $\ZZ^{F\_k}$, then that cocyle is cohomologous to one in $\ZZ^{F\_k}$. That sounds like some easy linear algebra, although I don't see a one line proof.


