Suppose that I have a function in $f \in L^1(\mathbb{R})$ such that $$\int_{\mathbb{R}}f(x)v'(x)\,dx = 0$$ for all test functions $v$ which are smooth with compact support. Can I show that $f(x)$ is almost surely a constant?
This is clearly true if $f$ is smooth, but what if I just assume that $f \in L^1(\mathbb{R})$?
Yes.
If $\phi$ is a test function then dominated convergence shows that$$(f*\phi)'=f*\phi'=0,$$so $f*\phi$ is constant. There is a sequence of test functions $\phi_n$ so $f*\phi_n\to f$ almost everywhere.