Continuous Functions Converging to Zero with Integral Tending to Infinity – Real Analysis

real-analysis

I wish to find a continuous function $f_n:[0,1]\rightarrow\mathbb{R}$ such that $f$ converges pointwise to 0, but also $\int^1_0f_n\rightarrow\infty$

Then another $f_n:[0,\infty)\rightarrow\mathbb{R}$ continuous satisfying $||f_n||_\infty\rightarrow 0$ but with $\int_0^\infty f_n=1$

For the first one every point in 0 to 1 must converge to 0, but the area underneath them must not (which really confuses me because $f$ is continuous, it can't jump)

For the second one, the sup norm tending towards zero means the largest value $f_n$ takes must tend towards zero, but the area must be 1. I'm thinking of some sort of function that spreads out might work but keeping it continuous is the difficult part.

I've been thinking for over an hour (I hate to admit) and really quite stumped, this is a past exam question (no solutions available) and I have no ideas left about how to find such a function.

I've been looking for a theorem to negate or abuse so I can get a definition I must get a function to satisfy, which is really hard with the continuous constraint.

Best Answer

Let $$g(x)=\begin{cases}x&\text{if }0\le x\le 1\\ 2-x&\text{if }1\le x\le 2\\ 0&\text{if }x\ge 2\end{cases}$$ and then $f_n(x)=n^2g(nx)$ for the first problem and $f_n(x)=\frac1ng(x/n)$ for the second problem.