If $f$ is a continuous real-valued function, show that $$ f(1)=\lim_{n\to \infty} \int_0^1 (n+1)\,x^n \,f(x) \; dx $$
I am looking for a general hint or steps to proceed but I want to fill them in. Looking at this I see the '$n+1$' along with the $\int x^n$ makes me very suspicious.
My first thought is that $(n+1)x^nf(x)$ converges to $f(1)$ uniformly on $[0,1]$ but I feel as though this is a fools thought. I then sat and tried the case $f(x)=x$ and $f(x)=x^{n_0}$. This was a bit illuminating. I then tried the case where $f(x)$ is a general polynomial and I can show that case. But of course $f(x)$ need not be a polynomial.
To try to make this method work, I considered using Stone-Weierstrass. I can find a sequence of polynomials $p_n(x)$ such that $p_n(x) \to f(x)$ uniformly. But I am unsure of how to make it fit in with the integral. I assume it is trivial to show $x^np_n(x) \to x^nf(x)$. I know that the above limit works with $x^np_n(x)$. However, does this imply that this -- under the limit -- must be the same as $x^nf(x)$? Or is this not at all how I should go about it? Is there a better or easier way? Or perhaps a more enlightening or 'quaint' way?
Note that since $[0,1]$ is compact $f$ is uniformly continuous and bounded, say $|f| \leq K$ on $[0,1]$. Split the integral into a portion close to $1$ and far from $1$.
$$ \int_0^{1-\epsilon} (n+1) x^n f(x) dx + \int_{1-\epsilon}^1 (n+1)x^n f(x)dx $$
Let's look at the first integral
$$ \left|\int_0^{1-\epsilon} (n+1) x^n f(x) dx\right| \leq (n+1)(1-\epsilon)^n K \to 0 $$ as $n \to \infty$. Now since $f$ is uniformly continuous, we can choose $\epsilon$ small enough that $|f(x)-f(1)| \leq \delta$ on $(1-\epsilon,1]$. Examining the second integral (read from the middle out, not left to right) $$ (f(1)-\delta)[1-(1-\epsilon)^{n+1}] = \int_{1-\epsilon}^1 (n+1)x^n (f(1)-\delta)dx\leq \int_{1-\epsilon}^1 (n+1)x^n f(x)dx \leq\int_{1-\epsilon}^1 (n+1)x^n (f(1)+\delta)dx = (f(1)+\delta)[1-(1-\epsilon)^{n+1}] $$ So $$ \int_0^{1-\epsilon} (n+1) x^n f(x) dx + \int_{1-\epsilon}^1 (n+1)x^n f(x)dx = \text{small} + \text{close to $f(1)$} $$ do you see how to finish/fill in the details?