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?
Suppose that $$ \int_{\mathbb{R}}f(x)\phi'(x)\,\mathrm{d}x=0\tag{1} $$ for all $\phi\in C_c^\infty$. Then consider the functions $$ \psi_{a,\lambda}(x)=\left\{\begin{array}{} 0&\text{for $x\lt a$}\\ \frac{x-a}\lambda&\text{for $x\in[a,a+\lambda]$}\\ 1&\text{for $x\gt a+\lambda$}\tag{2} \end{array}\right. $$ By approximating $\psi_{a,\lambda}-\psi_{b,\mu}$ as close as we want (in $L^\infty$) by $\phi\in C_c^\infty$, we get that $$ \int_{\mathbb{R}}f(x)\phi'(x)\,\mathrm{d}x\tag{3} $$ approximates $$ \frac1\lambda\int_a^{a+\lambda}f(x)\,\mathrm{d}x-\frac1\mu\int_b^{b+\mu}f(x)\,\mathrm{d}x\tag{4} $$ Since $(3)$ is $0$, we get that $(4)$ must be as well. This means that $$ \frac1\lambda\int_a^{a+\lambda}f(x)\,\mathrm{d}x=\frac1\mu\int_b^{b+\mu}f(x)\,\mathrm{d}x\tag{5} $$ Since almost every point is a Lebesgue point of a locally integrable function, $(5)$ means that $$ f(a)=\int_0^1f(x)\,\mathrm{d}x\tag{6} $$ for almost all $a\in\mathbb{R}$.