I wonder, if the following is true: Let $(M,g)$ be a compact Riemannian manifold and $f \in \mathcal{C}^{\infty}(M)$ be a smooth function. Then $f$ is constant if and only if for all $u \in \mathcal{C}^{\infty}(M)$ such that $\int_M{u dv^g}=0$, we have:
$$ \int_M{f u dv^g} = 0. $$
Thoughts on this:
I have the feeling that this is a generlization of the $1$-dimensional analogue (see Prove Corollary of the Fundamental lemma of calculus of variations) Since the fundamental Lemma holds in this situation, too, should'nt this corollary also hold?
This claim is a stronger claim than A variation of fundamental lemma of variation of calculus ., but maybe the OP of that question meant the same.
One can probably replace $(M,g)$ by any open subset of Euclidean space, if that helps.