I am trying to solve the following exercise:

Let $f:\mathbb R \to \mathbb R$ be a continuous function such that for every $a<b$, the integral $\int\_a^b fdf$ exists and is $0$. Prove that $f$ is a constant function. 

The attempt at a solution:

I would like to pick an arbitrary $c \in \mathbb R$ and a fixed number (call it $a$) and conclude that $f(c)=f(a)$ for every $c \in \mathbb R$.

I know that if I fixed $a$, then for $c : a<c \space$, $\space 0=\int\_a^c fdf=f^2(c)-f^2(a)-\int\_a^cfdf=f^2(c)-f^2(a)$, so $|f(a)|=|f(c)|$. If $c<a$, analogously I would conclude that $|f(c)|=|f(a)|$, but this is not sufficient to prove the function is constant, from here all I would conclude is that the function takes two values: $f(a)$ or $-f(a)$.