More about Weierstrass theorem I just fix the previous question, but now I have another one
$\text{Let }f:[0,1]\to \Bbb R\text{ be a continuous function}$
Evaluate the function
$$\lim_{n\to \infty}n\int_{0}^{1}x^nf(x)\,dx$$
My idea is to do just like what I've done in the previous question, only to multiply $n$ in the integral, becomes
$$
\begin{align}
0\le n\int_{0}^{1}x^n\,|f(x)|\,dx & \le n\int_{0}^{1}x^n|f(x)-p(x)|\,dx+n\int_{0}^{1}x^n|p(x)|\,dx\\
& \le n\int_{0}^{1}x^n|f(x)-p(x)|\,dx+n\int_{0}^{1}x^n\sum_{i=0}^{m}\lvert a_ix^i\rvert\,dx
\end{align}
$$
and $$n\int_{0}^{1}x^np(x)\,dx=\frac{na_0}{n+1}+\frac{na_1}{n+2}+\frac{na_2}{n+3}+\cdots+\frac{na_m}{n+m+1}
 \to p(1)$$
as $n\to\infty$.
But I stuck because first, I'm doing $|f(x)|$ not $f(x)$
and second, I just know it's upper bound, and I can't use pinching because the lower bound is $0$
I want to compute its lower bound but how?
 A: Let us suppose that in addition $f$ is $C^1$. We already know (your previous question) that $\lim_{n\to\infty}\int_0^1x^nf(x)dx=0$, therefore we can study $$\int_0^1(n+1)x^nf(x)dx$$instead.
We integrate by parts to obtain
$$x^{n+1}f(x)\big|_{x=0}^{x=1} - \int_0^1 x^{n+1}f'(x)dx \to f(1)\quad \text{as}\quad n\to\infty$$
by your previous question.
Now in the case where $f$ is not necessarily differentiable, we can find a $C^1$ uniform approximation (use Weierstrass-Stone theorem if you want):
$$\forall \varepsilon>0\exists g\in C^1[0,1]\quad \text{such that}\quad \|f-g\|_\infty<\varepsilon.$$ Moreover, we can choose $g$ such that $g(1)=f(1)$.
Therefore $$ n\int_0^1x^nf(x)dx= \int_0^1nx^n(f(x)-g(x))dx + \int_0^1nx^n g(x)dx.$$
The first term can be made arbitrarily small by a choice of $g$:
$$\int_0^1|nx^n(f(x)-g(x))|dx\le \varepsilon \int_0^1nx^n = \varepsilon \frac{n}{n+1}$$
and the second one converges to $g(1)=f(1)$ by the first part of this answer.
Therefore, we can conclude that
$$\lim_{n\to\infty}n\int_0^1x^nf(x)dx=f(1).$$
A: Define
$$
\psi_n(x)=(n+1)x^n
$$
We have that $\psi_n(x)\ge0$ and $\int_0^1\psi_n(x)\,\mathrm{d}x=1$. Furthermore, on $[0,1-\delta]$
$$
\|\psi_n(x)\|_\infty\le(n+1)(1-\delta)^n
$$
and, for any $0\lt\delta\lt1$, $\lim\limits_{n\to\infty}(n+1)(1-\delta)^n=0$.
Since $f$ is continuous, given $\epsilon\gt0$, there is a $0\lt\delta\lt1$ so that for all $1-\delta\le x\le1$, we have $|f(x)-f(1)|\le\epsilon$.
$$
\begin{align}
\left|\,\int_0^1\psi_n(x)f(x)\,\mathrm{d}x-f(1)\,\right|
&=\left|\,\int_0^1\psi_n(x)(f(x)-f(1))\,\mathrm{d}x\,\right|\\
&\le\int_0^1\psi_n(x)\left|f(x)-f(1)\right|\,\mathrm{d}x\\
&=\int_0^{1-\delta}\color{#C00000}{\psi_n(x)}\color{#00A000}{\left|f(x)-f(1)\right|}\,\mathrm{d}x\\
&+\int_{1-\delta}^1\color{#0000F0}{\psi_n(x)}\color{#C08000}{\left|f(x)-f(1)\right|}\,\mathrm{d}x\\[9pt]
&\le\color{#C00000}{(n+1)(1-\delta)^n}\color{#00A000}{(\|f\|_1+|f(1)|)}\\[12pt]
&+\color{#0000F0}{1}\cdot\color{#C08000}{\epsilon}
\end{align}
$$
Thus,
$$
\lim_{n\to\infty}\left|\,\int_0^1\psi_n(x)f(x)\,\mathrm{d}x-f(1)\,\right|\le\epsilon
$$
and since $\epsilon\gt0$ was arbitrary, we have
$$
\lim_{n\to\infty}\left|\,\int_0^1\psi_n(x)f(x)\,\mathrm{d}x-f(1)\,\right|=0
$$
Therefore,
$$
\begin{align}
\lim_{n\to\infty}\int_0^1nx^nf(x)\,\mathrm{d}x
&=\lim_{n\to\infty}\frac{n}{n+1}\int_0^1\psi_n(x)f(x)\,\mathrm{d}x\\[6pt]
&=f(1)
\end{align}
$$
A: You can approximate any such $f$ by a continuously differentiable function. For such a function it is easy to prove using integration by parts:
$$n\int_0^1 x^n f(x) dx = \frac{n}{n+1} x^{n+1}f(x) \bigg{\vert}_0^1 - \frac{n}{n+1} \int_0^1 x^{n+1} f(x)dx. $$
The first term goes to $f(1)$. The second one goes to $0$ by your previous question.
I was going to use an $L^2$ approximation $g$ to $f$, so that $g \in C^2$ and $||f-g||_{L^2}< \epsilon$, and such that $g(1)=f(1)$. Then I can write
$$\bigg{\vert} n\int x^n(f(x)-g(x)dx \bigg{\vert} \leq \epsilon n \bigg{\vert}\int x^{2n} dx \bigg{\vert} \leq \epsilon \frac{n}{2n+1.}$$
