Let $f:[0,1]\to\mathbb{R}$ be a continuous function such that $$\int_0^1 x^n (1-x) f(x)dx=0$$ Show that there is a $c\in(0,1)$ such that $$c^n f(c)=\int_0^c x^n f(x)dx.$$ where $n$ is a non-negative integer.
Special case:$n=0$
If $\int_0^1 (1-x) f(x)dx=0$ so there is a $c\in(0,1)$ such that $$f(c)=\int_0^c f(x)dx$$ that solved here.
Special case:$n=1$
If $\int_0^1 x (1-x) f(x)dx=0$ so there is a $c\in(0,1)$ such that $$cf(c)=\int_0^c xf(x)dx.$$
Proof:
Define the function $g:[0,1]\to\mathbb{R}$, such that
$$g(x)=x\int_0^x t^n f(t)dt-\int_0^x t^{n+1}f(t)dt, \forall x\in[0,1].$$
So
$$g'(x)=\int_0^x t^n f(t)dt+x^{n+1}f(x)-x^{n+1}f(x)=\int_0^x t^n f(t)dt, \forall x\in[0,1].$$
Observe that $g(0)=g(1)=0$. Hence by Rolle's Theorem $\exists b\in(0,1)$, such that $g'(b)=0$, that is,
$$\int_0^b t^n f(t)dt=0.$$
Now define $h:[0,1]\to\mathbb{R}$, such that $$h(x)=e^{-x}g'(x), \forall x\in[0,1].$$
Now $h'(x)=-e^{-x}g'(x)+g''(x)e^{-x}=e^{-x}(g''(x)-g'(x)), \forall x\in[0,1].$
Observe that $h(0)=h(b)=0$. Hence by Rolle's Theorem $\exists c\in(0,b)\subseteq (0,1)$, such that $h'(c)=0$. So $$e^{-c}(g''(c)-g'(c))=0\\\implies g''(c)-g'(c)=0\hspace{0.3 cm} \\\implies c^nf(c)=\int_0^c x^nf(x)dx.$$
Is this calculation valid? (Also the solution here is almost identical to the solution in here, but more general)