$\int fg = 0$ implies $f =0$? Let $\Omega \subseteq \mathbb{R}^{n}$ an open set and let $f,g: \Omega \to \mathbb{R}$ be $C^{k}$, where $k \ge 0$ ($k=0$ implies the functions are only continuous). Note that $k$ can be $k=+\infty$. Suppose:
$$\int_{\Omega}f(x)g(x)dx = 0$$
for every $g$ with compact support. Does it follow that $f \equiv 0$?
Note: I know the result follows if $\Omega = I\subseteq \mathbb{R}$ is an interval and if $k=0$ or $k=\infty$. I'd like to know if this also holds in the case where $\Omega \subseteq \mathbb{R}^{n}$ is just an open set and $k \ge 0$ is arbitrary.
Note 2: I have sketched a proof as follows.
Sketch of the proof: Suppose that $f(x^{*}) \neq 0$ for some $x^{*} \in U$. Without loss of generality, we can assume $f(x^{*}) > 0$. Because $f \in C^{k}(\Omega)$ for some $k\ge 0$, $f$ is, in particular, continuous at $x^{*}$. Thus, there exists an open ball $B_{r}(x^{*})\subset U$ with radius $r$ and centered at $x^{*}$ such that if $x \in B_{r}(x^{*})$ then $f(x) > 0$. Then, take $g$ to be a $C^{k}(\Omega)$ function which is 1 on $\overline{B_{r}(x^{*})}$ and zero otherwise.
$$0 = \int_{\Omega}f(x)g(x)dx = \int_{\overline{B_{r}(x^{*})}}f(x)dx $$
which is an absurd!
The problem is that I don't know if I can always construct such a function $g$ which is $C^{k}(\Omega)$, $g=1$ inside $\overline{B_{r}(x^{*})}$ and zero otherwise.
 A: Yes, this is true, and you can even weaken the hypotheses by a lot more; though the weaker the hypotheses, the more technical the arguments (the ideas remain the same though).
Let me work with the case $k=0$. Suppose for the sake of contradiction there exists an $x_0\in \Omega$ such that $f(x_0)\neq 0$; for the sake of definiteness, let us assume that $f(x_0)>0$. Then, by continuity, there exists a small open ball $B_r$ of radius $r$ centered at $x_0$ and whose closure lies inside $\Omega$ such that for every $x\in \overline{B_r}$, we have $f(x)>0$. Now, let $g$ be a continuous function which is equal to $1$ on $B_{r/2}$, and which decays to $0$ continuously having support within $B_r$ (i.e we're taking the constant function $1$, and "cutting it off" before it reaches the boundary of the ball $B_r$). Then, we can extend $g=0$ outside $B_r$, so we have a continuous function on all of $\Omega$. So,
\begin{align}
0&= \int_{\Omega}f(x)g(x)\,dx\tag{by assumption}\\
&= \int_{B_r}f(x)g(x)\,dx \tag{since $g=0$ outisde $B_r$}\\
& \geq \int_{B_{r/2}}f(x)\cdot 1\,dx\\
&>0.
\end{align}
This is clearly a contradiction.

As you can see, the idea is pretty simple: suppose $f\neq 0$; then we find some larger compact set on which $f$ does not vanish. Then, we take a cut-off function $g$. Above, I only required $g$ to be continuous; but we by using convolutions we can even find smooth functions. Then, the remainder of the proof proceeds similarly.
A: This is not a complete answer, but I can't comment
If you admit that $\int f^2 = 0$ implies that $f=0$ then this is pretty straightforward.
The idea is to take $g$ so that you integrate something positive on $\Omega$. Make sure that the $g$ you choose is still with compact support.
A: Here is the key result. If $K$ is compact and $G$ is open in $\mathbb{R}^d$, then there is a $\psi\in \mathcal{C}^\infty(\mathbb{R}^d)$ function of compact support so that $\psi = 1$ on $K$ and so ${\rm supp}(\psi) \subset G$.
