# Question about proof in: Let $f\in L^{1}_{loc}(I)$ with $\int_I f\phi^{'}=0 \, \forall \phi \in C^{1}_c(I)$, then $f = C$ a.e. on $I$.

I am currently reading Brezi's Book:"Functional Analysis, Sobolev Spaces and PDE's" and do not understand one step in the proof of the following lemma.

Let $$f\in L^{1}_{loc}(I)$$ be such that $$\int_I f\phi^{'}=0, \ \ \forall \phi \in C^{1}_c(I).$$ Then there exists a constant $$C$$ such that $$f = C$$ a.e. on $$I$$.

Proof. Fix a function $$\psi \in C_c(I)$$ such that $$\int_I \psi = 1$$. For any function $$w\in C_c(I)$$ there exists $$\phi \in C^{1}_c(I)$$ such that $$\phi^{'}=w-(\int_I w)\psi.$$ Indeed, the function $$h=w-(\int_I w)\psi$$ is continuous, has compact support in I and also $$\int_I h=0$$. Therefore $$h$$ has a (unique) primitive with compact support in I. We deduce from our assumption on $$f$$ that $$\int_I f[w-(\int_I w)\psi]=0,\quad \forall w \in C_c(I),$$ i.e., $$\int_I [ f-(\int_I f)\psi ]w=0,\quad \forall w \in C_c(I).$$ And therefore $$f-(\int_I f\psi)=0$$ a.e. on $$I$$ and we choose $$C=\int_I f\psi$$.

I don't understand the last step, replacing the $$f$$ and $$w$$ in the integral. I would really appreciate someone explaining that step even if it is really simple.

We have $$\int_I f(s) [ w(s)-(\int_I w(t) dt )\psi (s) ]ds =\int_I f(s) w(s) ds -\int_{I\times I } w(t) \psi (s) f(s) dt ds=\int_I f(t) w(t) dt -\int_{I\times I } w(t) \psi (s) f(s) dt ds=\int_I [ f(t)-(\int_I f(s) \psi (s) ds)]w(t)dt$$