Show $f(x) = 0$ given continuity and integrals.

I'm having some trouble with the following problem. I've listed what I've used so far.

(Edit: Made a mistake with the second integral.)

The problem is as follows:

If a function $f: [0,1] \rightarrow \mathbb R$ is continuous and $\int_0^x f = \int_x^1 f, \forall x \in [0,1]$, show that $f(x) = 0, \forall x \in [0,1]$.

I would assume a proof by contradiction. So assume that $\exists x \in [0,1]$ such that $f(x) \neq 0$.

By the FTOC, since $\int_0^x f = \int_x^1 f$, it follows that if $F'(x) = f(x), \forall x \in [0,1]$, then $F(x)-F(0) = F(1) - F(x)$, or equivalently:

$F(x) = \dfrac{F(1)+F(0)}{2}$.

I'm wondering whether the given approach is correct or whether I should prove the question in a different approach.

Any feedback would be appreciated!

-

You have that $$\int_0^x f=\int_x^1 f$$ for each $x\in[0,1]$. By FTC, upon differentiation, you get that $$f(x)=-f(x)$$ for each $x\in [0,1]$. That is $2f(x)=0$ or $f(x)=0$ over $[0,1]$.