Let $D$ be the set of functions $\Bbb{R} \to \Bbb{C}$ of the form
$$ D = \Big\{ \sum_{k=1}^{n} c_k \mathrm{e}^{it_k x} : c_1, \cdots, c_n \in \Bbb{R}, t_1, \cdots, t_n \in \Bbb{R}, n \geq 1 \Big\}. $$
I would like to answer to the following question.
Question. If $f : \Bbb{R} \to \Bbb{C}$ is such that $(1+x^2)^{-1/2}f(x) \in L^2(\Bbb{R})$ and $$ \forall \varphi \in D: \quad \int_{\Bbb{R}} \frac{f(x) \varphi(x)}{1+x^2} \, \mathrm{d}x = 0, $$ then is it true that $f = 0$?
A more suggesting way of stating the question would be as follows:
Q (version 2). Suppose that $f \in H^{-1}(\Bbb{R})$ satisfies $\langle f, \mu \rangle_{H^{-1}} = 0$ for all $\mu$ which are molecular masses (linear combination of point masses). Does it imply that $f = 0$?
In other words, does the set of all molecular masses dense in $H^{-1}(\Bbb{R})$?
To be honest, I have no idea whether this is true or not, much less how I should attack this. The best scenario is that this is indeed true, so I am pushing that direction. But what I am doing just feels like throwing computation at the wall and see what sticks.
Any help would be appreciated!
EDIT. If we denote by $\mathcal{M} \subset H^{-1}(\Bbb{R})$ the space of molecular masses, then it seems that $C_{c}^{\infty}(\Bbb{R})$ is a subspace of the closure $\bar{\mathcal{M}}$ in $H^{-1}(\Bbb{R})$ through the standard approximation: for $f \in C_c^{\infty}(\Bbb{R})$ and $t_k = k \Delta t$,
$$ \sum_{k=-\infty}^{\infty} f(t_k) \delta(t - t_k) \Delta t \quad \rightarrow \quad f(t) \quad \text{in }H^{-1}(\Bbb{R}). $$
That said, if we can prove that $C_{c}^{\infty}(\Bbb{R})$ is dense in $H^{-1}(\Bbb{R})$ then we also have $\bar{\mathcal{M}} = H^{-1}(\Bbb{R})$. However I have not much knowledge on this space, and a quick googling failed to answer this.
EDIT 2. I came up with a straightforward solution:
If $f$ is as in Question, then $(1+x^2)^{-1}f(x) \in L^1(\Bbb{R})$ by Cauchy-Schwarz. Then the condition implies that
$$ \forall \xi \in \Bbb{R} : \quad \int_{\Bbb{R}} \frac{f(x)}{1+x^2} \mathrm{e}^{-i\xi x} \, \mathrm{d} x = 0. $$
This tells that $(1+x^2)^{-1}f(x) = 0$ a.e. and hence $f(x) = 0$ a.e.
p.s. Thank you for the user who hinted this solution in their comment and then erased it.
I have to admit that I don't completely understand your reformulation, but it certainly is true that $C_0^{\infty}$ is dense in $$ H^{-1} = \{ f\in\mathcal S' : (1+t^2)^{-1/2}\widehat{f}(t)\in L^2 \} , \quad \|f\|_{H^{-1}} = \| (1+t^2)^{-1/2}\widehat{f}\|_2 . $$ Clearly, compactly supported continuous functions are dense in $L^2((1+t^2)^{-1}\, dt)$, and if such a $g$ is given, we simply ignore the weight and approximate it in $L^2(\mathbb R; dt)$ (which is more than originally asked for).
To approximate $g$ by functions with smooth compactly supported Fourier transform, we simply choose a $\widehat{\varphi}\in C_0^{\infty}$ with $\widehat{\varphi}(0)=1$, and take $\varphi_n*g$ as our approximations, with $\varphi_n(x)=n\varphi(nx)$.