Let $f(\not\equiv 0)$ be an arbitrary continuous function from $\mathbb{R}^n \to \mathbb{R}$. Can we find/construct a Schwarts function $g \in \mathcal{S}(\mathbb{R}^n)$ such that
$$\int_{\mathbb{R}^n} g^2f \,dx \neq 0$$
(where $dx$ is a Lebesgue measure) ?
Any help would be very much appreciated!
Let $x_0$ a point where $f(x_0) > 0$ (or $<0$ if none of them exist). By continuity, we can find some $r>0$ such that $f(x)>0$ for all $x \in B(x_0,r)$, the open ball centered at $x_0$ with radius $r$.
Then just chose $g$ as a a non-negative and non-zero $C^\infty$ function with compact support $K \subset B(x_0,r)$.