<s>[INST] How can I construct a sequence of smooth functions $g_n$ s.t their integrals converge to zero? Define $g_n(x)$ to be zero on $[0,1-\frac{1}{n}]$ and $g_n(x)=ax^2+bx+c$ on $[1-\frac{1}{n},1]$
I want the $g_n$ functions to be in $C^2[0,1]$ and statifies $g_n(0)=0$ and $g_n(1)=1$, $g_n'(0)=0$ and their integrals to converge to zero as suggested in the comments.
I solved the linear system in $a,b,c$ but to give: $a=n^2$, $b=-2n^2+2n$ and $c=(n-1)^2$
\begin{align}
\int_0^1 g_n(x)= \int_0^{1-\frac{1}{n}} 0 dx +  \int_{1-\frac{1}{n}}^1 n^2x^2 -2n(n+1)x+ (n-1)^2 dx = \dfrac{n^2-3n+3}{3}-\dfrac{n^3-3n^2+3n-1}{3n}=\dfrac{3}{n}
\end{align}
so Let $a_n=\frac{3}{n}$
\begin{align}
\lim_{n \to \infty} a_n=\dfrac{n^2-3n+3}{3}-\dfrac{n^3-3n^2+3n-1}{3n} =\lim_{n \to \infty} \frac{3}{n} =0
\end{align}
EDIT: Updated the body of the question
 [/INST] As it was pointed out in the comments, the functions $g_n$ are not even continuous en $[0,1]$. Regarding the second part, it is true that $\int_0^1 g_n(x) dx \to 0$ and your justification is correct.
</s>