To prove $f(x)= x^3$ for all $x\in \mathbb{R}$ 
Let $f:[0,1] \to \mathbb{R}$ be a continuous function such that $f(x) \geq x^3$ for $x \in [0,1]$. Also $$\int_{0}^{1} f(x) \mathrm dx= \frac14$$ Prove that $f(x)= x^3$ for all $x\in [0,1]$

I am completely lost in here. Any hint will be appreciated.
 A: Consider $g(x) = f(x) - x^3$. The condition translates into $\displaystyle \int_{0}^{1} g(x)dx = 0$, with $g(x) \ge 0$ and $g$ is continuous. The new problem is old and has been posted couple times here. Assume $g(x_0) > 0$ for some $x_0$, then you can find a small interval $(c,d) \subset (0,1)$ such that $g(x) > 0, \forall x \in (c,d)$ and contradiction arrives since $\displaystyle \int_{0}^1 g(x)dx > \displaystyle \int_{c}^d g(x)dx > 0$.
A: It's trivial to show that $$\int_0^1x^3dx=\frac14$$Now, since $f(x)\geq x^3$ on the domain, we can define $$\int_0^1 f(x)dx = \frac14+\int_0^1 f(x)-x^3 dx$$Now, suppose that $\exists x\in[0,1]$ such that $f(x)>x^3$. Then, by continuity, $\exists\epsilon>0$ such that $\forall y\in(x-\epsilon,x+\epsilon)$, $f(y)>y^3$. Let $d$ be the average difference between $f(y)$ and $y^3$ over this neighborhood. Hence, $$\int_0^1f(x)-x^3dx = \int_0^{x-\epsilon}f(x)-x^3dx + 2\epsilon\cdot d + \int_{x+\epsilon}^1f(x)-x^3dx\geq2\epsilon\cdot d>0$$This is a contradiction. Hence, $f(x)=x^3$
A: For continuous $f,g,$ if $f(x) > g(x)$ for all $x\in [a,b]$ then $\int_a^b f(x) > \int_a^b g(x).$  Think about the Riemann sum definition of the integral as to why this would be the case.
Given $f(x) \ge g(x)$ and $\int_a^b f(x) = \int_a^b g(x)$ (that second bit you still have to show) then it must be the case that $f(x) = g(x)$ for all $x$ in the interval $[a,b].$
