Originally Posted by

**flyingsquirrel** Hi

How about $\displaystyle f:\mathbb{R}^+\mapsto\mathbb{R}$ such that for all $\displaystyle n\in\mathbb{N}^*$, $\displaystyle f$ is defined on every $\displaystyle [n,\,n+1]$ by $\displaystyle f(x)=\left\{\begin{array}{ll}

n^4(x-n)&\mbox{ if } x\in\left[n,\,n+\frac{1}{n^3}\right]\\

-n^4\left(x-n-\frac{2}{n^3}\right)& \mbox{ if } x\in\left[n+\frac{1}{n^3},\,n+\frac{2}{n^3}\right]\\

0 & x\in\left[n+\frac{2}{n^3},\,n+1\right]

\end{array}\right.$ and $\displaystyle f=0$ on $\displaystyle [0,\,1]$ ?

On each interval $\displaystyle [n,\,n+1]$, the curve of the function has the shape of a triangle which has one vertex at $\displaystyle (n,0)$, one at $\displaystyle \left(n+\frac{1}{n^3},\,n\right)$ and one at $\displaystyle \left(n+\frac{2}{n^3},\,0\right)$. As $\displaystyle n$ approaches $\displaystyle \infty$, the height of the triangle does the same (see the second vertex) so the function is not bounded. It can be checked that this function is continuous on $\displaystyle \mathbb{R}^+$. As, for $\displaystyle n>0$, $\displaystyle \int_n^{n+1}f =\frac{1}{2}\frac{2}{n^3}n$ (it's the area of a triangle which height is $\displaystyle n$ and which base is $\displaystyle \frac{2}{n^3}$), we get that $\displaystyle \int_0^{\infty}f=\sum_{k=1}^{\infty}\frac{1}{k^2}= \frac{\pi^2}{6}$ and the function is integrable.

As we want $\displaystyle \int_{\mathbb{R}}f=0$, we define for $\displaystyle x<0$, $\displaystyle f(x)=-f(-x)$ and that's it.