TITLE: Find the increasing function $f:\mathbb{R} \to \mathbb{R}$ such that $\int_{0}^{x}f(t)\,dt=x^2$ for all $x\in \mathbb{R}$
QUESTION [6 upvotes]: Find the increasing function $f:\mathbb{R} \to \mathbb{R}$ such that $$\int_{0}^{x}f(t)\,dt=x^2\text{ for all }x\in \mathbb{R}$$
My solution: Let $F:\mathbb{R} \to \mathbb{R}$,$F(x)=\int_{0}^{x}f(t)\,dt$.
Then it follows that $F$ is differentiable and that $F'(x)=2x$ for all $x\in \mathbb{R}$.
For $a\in \mathbb{R}$ we have that $$2a=F'(a)=\lim_{x\searrow a}\frac{F(x)-F(a)}{x-a}=\lim_{x\searrow a}\frac{\int_{a}^{x}f(t)\,dt}{x-a}\ge \lim_{x\searrow a} \frac{\int_{a}^{x}f(a)\,dt}{x-a}=\lim_{x\searrow a}\frac{(x-a)f(a)}{x-a}=f(a)$$
and $$2a=F'(a)=\lim_{x\nearrow a}\frac{F(x)-F(a)}{x-a}=\lim_{x\nearrow a}\frac{\int_{a}^{x}f(t)\,dt}{x-a}\le \lim_{x\nearrow a} \frac{\int_{a}^{x}f(a)\,dt}{x-a}=\lim_{x\nearrow a}\frac{(x-a)f(a)}{x-a}=f(a).$$
From these two relations it follows that $f(x)=2x$ for all $x\in \mathbb{R}$.
I think that my solution works, but what I would like to know is why we can't take $f$ to be decreasing. Assuming that it were decreasing, by reversing the inequalities from above we get that $f(x)=2x,\forall x \in \mathbb{R}$, which is a contradiction. What I want to find out is if there is any other way to reach a contradiction in this case. More precisely, I would like to know what may have motivated the authors of this problem to consider $f$ to be increasing instead of decreasing(I doubt that they just tried both cases and chose the one that actually worked).

REPLY [2 votes]: $f(x)=2x$ whenever $f$ is continuous at $x$. Since $f$ is increasing it is continuous except at a countable number of points Hence it is continuous on a dense set. Given any $x$ choose an increasing sequence $(x_n)$ and a decreasing sequence $(y_n)$ both tending to $x$ such that $f$ is continuous at each $x_n$ and at each $y_n$. Then $2x_n=f(x_n)\leq f(x) \leq f(y_n)=2y_n$. Letting $n \to \infty$ you get $f(x)=2x$.