I am trying to solve this exercise:
Let $u: [a,b]\to \mathbb R$ be piecewise continuous. Prove that $\int_a^b u(x)\eta'(x)dx =0 \forall \eta \in C^\infty_c ((a,b);\mathbb R)$ implies that $\int_a^b u(x)\eta'(x)dx =0 \forall \eta \in D_0^1 ([a,b];\mathbb R)$
Hint: It suffices to show that for every $\psi \in D_0^1 ([a,b];\mathbb R)$ there exists a sequence of functions $\psi_m \in C_c^\infty((a; b); \mathbb R)$ such that $ \int_a^b|\psi_m '(x) − \psi'(x)| dx \to 0$.
To this end approximate $\psi \in D_0^1 ([a,b];\mathbb R)$ first with a function $\tilde \psi \in D_c^1 ([a,b];\mathbb R)$ and then construct the sequence $\psi_m$ of functions by convolution of $\tilde \psi$ with mollifiers
Note : $D^1([a,b];\mathbb{R}^n)$ is the class of piecewise continuously differentiable functions:
$ D^1([a,b];\mathbb{R})=\{ u \in C([a,b]);\mathbb R : \exists a=x_0<x_1<...,x_N=b:u|_{[x_{i-1}-x_i]} \in C^1([x_{i-1},x_i];\mathbb R), i = 1,...,N \}$
The subindex $0$ means that the functions vanish at the endpoints and the subindex $c$ means that functions have compact support
My try:
Let $\psi \in D^1_0([a,b];\mathbb{R})$
Define the cut -off function: $ \phi_n(x) = \begin{cases} 0, & x \in [a,a+1/n] \\ n(x-a-1/n), & x \in [a+1/n,a+2/n] \\ 1, & x \in [a+2/n,b-2/n] \\ -n(x-b+1/n), & x \in [b-2/n,b-1/n] \\ 0, & x \in [b-1/n,b] \\ \end{cases}$
Define $\tilde \psi_n = \psi\varphi_n, supp \tilde \psi_n =[a+1/n,b-1/n]\subseteq [a,b]\implies \tilde \psi_n \in D_c^1([a,b];\mathbb{R})$
Since $\phi_n \to 1_{[a,b]}$ as $n\to +\infty$, $\tilde \psi_n \to \psi$ as $ n\to +\infty$
Now take $\epsilon =1/m, m\in \mathbb{N}$ and consider the mollifiers $\rho_{1/m}$
Define $\psi_{m,n}=\rho_{1/m}*\tilde \psi_n \in C_c^\infty $ by the regularizing property of convolution
so $(\psi_{m,n})'=\rho_{1/m}*\tilde \psi_n'\to \tilde \psi_n' $ a.e
I am stuck here, it's getting messy because I have both the index from the cut-off approximation and the one from the mollification.Looks like according to the hint I should have approximated $\psi$ with a fixed $\tilde \psi $ instead of with a sequence and I needed $\psi_m$ with a single index not $\psi_{m,n}$.
I don't really understand why I need to approximate first with $D_c^1$ functions intead of mollifying $\psi $directly. Is my approach correct?, if so how do i deal with the two indices? If not, how should I have proceeded?