Existence of second weak derivative of $H^0$ "function" with additional properties Consider the following: Let $I=(a,b)\subset \mathbb{R}$ and $u,v \in H^0(I) :=W^{0,2}(I)=L^2(I)$ (the 0th Sobolev-Space) and let
$\int_I u \phi'' dx = \int_I w \phi dx~ \forall \phi \in C_c^\infty(I)$. 
I want to show that $u \in H^2(I)$ and $u''=w$. 
I received a hint: To show that $u \in H^1(I)$, consider $\psi \in C^\infty (I)$, such that $\psi|_{(a,a+\varepsilon)} \equiv0$ and $\psi|_{(b-\varepsilon,b)} \equiv1$ for sufficiently small $\varepsilon$ and use that $\forall \eta \in C_c^\infty(I)$ the function $\theta (x) = \int_{a}^{x}\eta (y)dy - (\int_{a}^{b}\eta(y)dy)\psi(x)$ belongs to $C^\infty_c(I) $.
So, certainly it holds that $\theta'(x)=\eta(x) -(\int_I\eta)\psi'(x) \iff \eta(x) = \theta'(x) + (\int_I\eta)\psi'(x)$. How to proceed? I guess it's just a question of plugging cleverly, but I don't see it. 
Best regards
Edit: So I found the following theorem, which might be of help: For $u \in H^0(I)$ the following are equivalent: 


*

*$u \in H^1(I)$

*There exists a constant $ C \in \mathbb{R} $, such that $ |\int_I u \varphi ' dx| \leq C \|\varphi\|_2$ for all $\varphi \in C^\infty_c(I)$.
 A: This is not an answer, but more an exploration of why my instinct is telling me something is missing. Perhaps another fellow student could see the hole(s) in either my logic or what more is needed. I agree it's not obvious when just plugging things in... Here is how I would start the proof using the hint:
I will write $\mu=\int_I\eta dx$ to clean up the notation a little. First, it should be clear that $\theta(x):=\int_a^x\eta(y)dy-\mu\psi(x)\in C_c^\infty$, given any $\eta\in C^\infty_c$? Thus, we want to use this definition of $\theta$ and our given property to show $\int_Iu\eta'dx=-\int_IW\eta dx$ for some $W$.
By definition,
$$\int_I u\theta''dx=\int_Iu(\eta'-\mu\psi'')dx=\int_Iu\eta'dx-\mu\int_Iu\psi''dx$$
and on the other hand as $\theta\in C^\infty_c$, by assumption
$$\int_Iu\theta''dx=\int_Iw\theta dx=\int_Iw\int_a^x\eta(y)dy dx-\mu\int_Iw\psi.$$
Applying integration by parts to the first integral on the RHS along with the first line gives the equality
$$\int_Iu\eta'dx-\mu\int_Iu\psi''dx=-\int_IW\eta dx-\mu\int_Iw\psi,$$
where $W(x)=W(0)+\int_a^xw(y)dy$ is a (weak) antiderivative of $w$. 
Since we know that we need $\int_Iu\eta'dx=-\int_IW\eta dx$ we only have left to show that $\int_Iu\psi''dx=\int_Iw\psi dx$. This is where I get hung up, because this need not be true in general: specifically, if $u$ is smooth enough, then a direct calculation gives $$\int_Iu\psi''dx=\lim_{x\rightarrow b^-}(-u'(x))+\int_Iu''\psi dx.$$
A: You have defined $\theta(x) = \int_{a}^{x}\eta dy-(\eta,1)\psi(x)$. As noted, $\theta \in \mathcal{C}_{c}^{\infty}(a,b)$ because $\psi$ is identically $1$ near $b$. Therefore the weak equation applies to $\theta$:
$$
           \int_a^b u\theta''dy = \int_a^bw\theta dy \\
           \int_a^bu(\eta'-(\eta,1)\psi'')dx=\int_{a}^{b}w\left(\int_{a}^{x}\eta dy-(\eta,1)\psi(x)\right)dx
$$
Interchange orders of integration, defining $\chi_{+}$ to be the characteristic function of $[0,\infty)$:
\begin{align}
        \int_{a}^{b}w\int_{a}^{x}\eta dy dx&=\int_{a}^{b}\int_{a}^{b}w(x)\eta(y)\chi_{+}(x-y)dy dx \\
       &=\int_{a}^{b}\eta(y)\int_{a}^{b}w(x)\chi_{+}(x-y)dx dy \\
       &=\int_{a}^{b}\eta(y)\int_{y}^{b}w(x)dxdy
\end{align}
Therefore,
$$
   \int_{a}^{b}u(\eta'-(\eta,1)\psi'')dx=\int_{a}^{b}\eta(y)\int_{y}^{b}wdx
   -(\eta,1)\int_{a}^{b}w\psi dx \\
    \int_{a}^{b}u\eta'dx=\int_{a}^{b}\eta\int_y^bwdx dy
        +(\eta,1)\int_{a}^{b}(u\psi''-w\psi)dx
$$
The only term that depends on $\psi$ is the second term on the right, which means that the second term on the right cannot vary with the choice of $\psi$, within the constraints imposed on $\psi$ in the problem statement. That is, there must be a constant $C$ such that the following holds for all $\psi$ as described in the problem:
$$
                 \int_{a}^{b}(u\psi''-w\psi)dx = C.
$$
Therefore, you have something very suggestive of integration by parts:
$$
   \int_{a}^{b}u\eta'dx=\int_{a}^{b}\eta\int_y^bwdx dy+\int_{a}^{b}\eta dy C,
         \;\;\; \eta \in \mathcal{C}_{c}^{\infty}(a,b).
$$
In other words,
$$
       \int_{a}^{b}u\eta'dx =\int_{a}^{b}\eta\left(\int_y^bwdx+\frac{C}{b-a}\right)dx,\;\;\; \eta\in\mathcal{C}_{c}^{\infty}.
$$
So $u$ has a weak derivative, and
$$
        u'(y) = \int_{y}^{b}wdx + \frac{C}{b-a},\;\;\; a.e. y\in [a,b].
$$
