Square differential forms in cohomology
Let $X$ be a differentiable manifold (connected, compact, orientiable) of dimension $4n$. Consider on $X$ a closed $2n$-form $\omega$, with associated cohomology class $[\omega] \in H^{2n}(X,\mathbb{R})$. The integral of its square is some real number, $$ \int_X \omega \wedge \omega \in \mathbb{R} \,, $$ which may be negative, positive, or zero. In general, the integrand $\omega \wedge \omega$ need not have the same sign everywhere as the result of the integral. However, the integral $\int_X \omega \wedge \omega$ is a function only of the cohomology class $[\omega]$, while $\omega \wedge \omega$ depends on the choice of representative $\omega \in [\omega]$. So my question is:
Is it possible to find a cohomologically equivalent $\omega' \in [\omega]$ such that everywhere $\mathrm{sgn}\big(\omega' \wedge \omega'\big) = \mathrm{sgn}\big(\int_X \omega \wedge \omega\big)$?
In the case that the answer is negative, I wonder if one can give criteria under which it holds.
A negative answer was given to a related question here. However, that answer crucially relied on the existence of the Massey triple product, which vanishes in the present case, so it doesn't seem possible to make a similar argument here.
No, this is not always possible. I'll analyze the case $n = 1$ because it is related to symplectic geometry. Note that the sign of $\omega' \wedge \omega'$ is not well-defined without choosing a specific orientation on $M$ while the condition $\omega' \wedge \omega' \neq 0$ does make sense so I'll use this condition instead. A two-form $\omega' \in \Omega^2(M;\mathbb{R})$ satisfies $\omega' \wedge \omega' \neq 0$ everywhere if and only if $\omega'$ is everywhere non-degenerate. So when $n = 1$, you are basically asking whether, given a cohomology class $[\omega]$ with $\int_{M} \omega \wedge \omega \neq 0$, can one find a closed, non-degenerate (i.e symplectic) two-form $\omega' \in [\omega]$?
To see that this is not always possible, take for example $M = \mathbb{CP}^2 \# \mathbb{CP}^2$. Denote by $\omega_{FS}$ the Fubini-Study symplectic form on $\mathbb{CP}^2$. Then $H^2(M) \cong H^2(\mathbb{CP}) \oplus H^2(\mathbb{CP})$. Let $\omega \in \Omega^2(M)$ be some representative of the cohomology class of $([\omega_{FS}],0)$. Then by the calculation of the cohomology ring of a connected sum, we have $$ \int_{M} \omega \wedge \omega = [\omega] \cdot [\omega] = [\omega_{FS}] \cdot [\omega_{FS}] = \int_{\mathbb{CP}^2} \omega_{FS} \wedge \omega_{FS} > 0. $$
However, it is "well-known" that the manifold $M$ has no almost-complex structure and so it has no symplectic two-form in $[\omega]$ (or in any other cohomology class).