Let $f \in L_{loc}^1 (\mathbb{R}) $ such that $ \int_{\mathbb{R}} f(x) \phi ' (x) dx = 0$, for every $\phi \in C_c ^{\infty}( \mathbb{R}) $. Show that there exist a $c \in \mathbb{R}$ such that $f(x) = c$ a.e.
What I did is:
Assume that $f \in C^ {\infty} $. Therefore, for every $a,b \in \mathbb{R}$, $ 0=\int _a ^b ff' = 1/2 (f(b)^2-f(a)^2)$. Considering that $f$ is continuous, we can conclude that $f(a) = f(b)$.
but i couldn't prove the general case. Any clue?