Let $a,b \in (0,1)$ be such that $a+b=1$ and $f:[0,1] \to \mathbb R$ be a continuous function such that $ \int_0^x f(t)dt=\int_0^{ax}f(t)dt+ \int_0^{bx}f(t)dt$. We have to prove that $f$ is constant.
Using the derivative, we get: $f(x)=af(ax)+bf(bx)$
I did the case $a=b=1/2$, but I don't know how to make it with $a,b$ arbitrary and $a,b \in (0,1)$ $a+b=1$
Let $f$ attain its minimum at $c$. Then $f(c) =af(ac)+bf(bc) \geq af(c)+bf(c)=f(c)$. Equality must hold throughout and we get $f(ac)=f(c)$. Iterating and taking limit we get $f(c)=f(0)$. Similarly the maximum value of $f$ is also $f(0)$ . Hence $f$ is a constant.