Show function $u$ is continuously differentiable with integration by parts 
Let $u$ be a continuous function. Assume for any $v$ that is continuously differentiable on $[0,1]$ and vanishes at the boundary points, $0$ and $1$, there exist a continuous function $f$ such that 
  $$ \int u v' \ dx = - \int f v \ dx \ .
$$
Show that $u$ is continuously differentiable and $u' = f$.

I have no idea what to do, please help.
 A: Suppose you manage to prove that $u' = f$. Then, since $f$ is assumed to be continuous, $u'$ is continuous as well; this is exactly what it means for $u$ to be continuously differentiable. 
Now, to show $u' = f$, use integration by parts to show that for every continuous function $v:[0,1] \to \mathbb{R}$, with $v(0) = v(1) = 0$, we have
\begin{equation}
\int_0^1 \left(u'(x)-f(x)\right)\cdot v(x) \, dx = 0
\end{equation}
Now, conclude from the fact that this is true for all $v$, that $u =f'$. (This last step is called the Fundamental Lemma of Calculus of Variations if I'm not mistaken; this is the toughest part of the proof)
A: Let $F_c(x)=\int^x_0f(t)\,dt +c$ for some constant $c$ to be determined. Then $F'_c=f$ and  $\int^1_0 f v=-\int^1_1 F_c v'$ for all continuously differentiable $v$ that vanishes at 0 and 1. Therefore, for all such $v$, 
$$\int^1_0 u v' =\int^1_0 F_c v' $$
Choose $c^*$ so that $\int^1_0 u =\int^1_0 F_{c^*}$. Applying the main identity to functions of the form $v_k(t)=e^{-2i\pi kt}-1$, with $k\in\mathbb{Z}\setminus\{0\}$ together with the choice of $c^*$ we obtain that 
$\int^1_0 u g=\int^1_0 F_{c^*} g$ holds for any trigonometric polynomial $$g(x)=\sum^N_{k=-M}c_k e^{i2\pi kx}$$
Consequently, $u=F_{c^*}$ almost surely in $[0,1]$ which in turn, by the continuity assumptions on $u$ leads to $u\equiv F_{c^*}$. (Here you can use Stone-Weierstrass theorem or the fact that trigonometric polynomials are dense in $L_2(\mathbb{S}^1)$).
A: Since $v'$ and $f$ are continuous, one can use integration by parts to get
$$
\int_0^1 v(x) f(x) \, dx = \underbrace{v(1)}_{=0}F(1) - v(0) \underbrace{F(0)}_{=0} - \int_0^1 F(x) v'(x) dx
= - \int_0^1 F(x) v'(x) dx,
$$
where
$$F(x) = \int_0^x f(t) dt$$
is of class $C^1$. (Up to this step we don't need $v(0)=0$.) Hence, the given identity becomes
$$
\int_0^1 \big( u(x) - F(x) \big) v'(x) dx = 0 \quad \text{for all } v \in C^1.
$$
As $v \in C^1$ is arbitrary and $u - F \in C^0$, the fundamental lemma of calculus of variations tells us that
$$
u(x) - F(x) = u(x) - \int_0^x f(t) dt = C \quad \text{everywhere in } [0,1],
$$
for some constant $C$. (In this step we need both $v(0)=0$ and $v(1)=0$.) This is enough to conclude that $u$ is of class $C^1$ with
$$
u' = f \quad \text{everywhere in } [0,1].
$$
