Find sequence of continuous functions $f_n : [0,1] \rightarrow \mathbb{R}$ converging pointwise on $[0,1]$ to a continuous function $f$ and such that $\int_ 0^1 f_n(x)dx = 2$ and $\int_0^1 f(x)dx = 1$.
Consider: $f_n$ =\begin{cases} 0 & x =0 \\ n & 0<x\leq \frac{1}{n} \\ 0 & \frac{1}{n}<x \leq 1 \end{cases}
I believe the sequence satisfies all the conditions except $\int_ 0^1 f_n(x)dx = 1$ and not 2. How to fix this?
Let $f_n(0)$ be $2n+1,$ $f_n(1/n)$ be $1$, and let $f_n(x)=1$ on $(1/n,1]$. On $(0,/1n)$ linearly interpolate the values.