Let $f \in L^2([0,1])$.
Assume that for every $\varphi \in W^{1,2}([0,1])$ we know that $$ \int_{0}^1 \varphi'(x) f(x) dx \leq \|\varphi \|_{W^{1,2}}. $$ Does this imply that $f$ belongs to $W^{1,2}([0,1])$?
My guess is yes because we can define $f'$ as $$ \int_0^1 \varphi(x) f'(x) dx = - \int_0^1 \varphi'(x) f(x) dx, $$ but I am not able to formalize this idea. Any hint is welcome, thank you
The answer is no. Consider the following function $f: [0,1] \to \Bbb R$: $$f(x) = \begin{cases} 0 & x < 1/2 \\ 1 &x \ge 1/2 \end{cases} $$ You can easily check that $f \in L^2$.
Moreover, for all $\varphi$ $$\int_0^1 \varphi'(x) f(x) \ \mathrm dx \le \int_0^1 | \varphi'(x) | \cdot 1 \ \mathrm dx \le ||\varphi||_{W^{1,2}}$$ However $f$ is a step function: it has no weak derivative.