Prove that $H^{2}(S^{2})\neq 0$
Suppose $\omega$ is an area form of $S^{2}$. An arbitrary two form on $S^{2}$ is closed as if $f(x,y)dx\wedge dy\in\Omega^{2}(S^{2})$ then $d(f(x,y)dx\wedge dy)=0$. I claim that $[\omega]\neq 0$ i.e $\omega$ is not exact. (then $\omega$ is not homologous to $0$).
Suppose by contradiction that $[\omega]=0$ i.e $\omega$ is exact, which means that$\;\exists\;\alpha\in\Omega^{1}(S^{2})$ such that $\omega=d\alpha$. Stoke's theorem gives now
$\text{Area}(S^{2})=\displaystyle\int_{S^{2}}\omega=\int_{S^{2}}d\alpha=\int_{\partial S^{2}}\alpha=0$ as $\;\partial S^{2}=\emptyset\;$, a contradiction.
Is it correct? Thank you.
Yes, that's correct. The same argument shows that for a compact orientable smooth manifold $M$ (without boundary) of dimension $n$, $H^n_{\text{dR}}(M) \neq 0$. As $M$ is orientable, there is a nowhere zero $n$-form $\omega$. As $M$ is $n$-dimensional, $d\omega = 0$, so $[\omega] \in H^n_{\text{dR}}(M)$. By the same argument as in your answer, $\omega$ cannot be closed, so $[\omega] \neq 0$. Therefore, $H^n_{\text{dR}}(M) \neq 0$. In fact, $H^n_{\text{dR}}(M) = \mathbb{R}$ but this requires a bit more work.