# Continuous functions vanishing at infinity is always integrable?

Let $$C_{0}(\mathbb R)= \big\{\,f:\mathbb R \to \mathbb C\,\,\, \text{continuous and}\,\, \lim_{x\to \pm \infty}f(x)=0 \big\}.$$

Assume that $f\in C_{0}(\mathbb R)$.

My question is: Is it always true that, $\int_{\mathbb R}|f(x)| dx < \infty ?$ If not, counter example ?

(My attempt: Since $f\in C_{0}(\mathbb R)$, so given $\epsilon >0$ there is a compact set $K\subset \mathbb R$ and $M> 0$ such that $|f(x)|\leq M$ for every $x\in K$ and $|f(x)|< \epsilon$ for every $x\in \mathbb R - K$; thus, $\int_{\mathbb R}|f(x)| dx = \int_{K}|f(x)| dx + \int_{\mathbb R -K} |f(x)|dx \leq C + \epsilon \mu(\mathbb R - K)$, where $\mu$ is Lebesgue measure on $\mathbb R$ ; but, certainly, this is incomplete argument !!)

• Let $f$ be some continuous function (defined piecewise) that is eventually $1/x$. – PVAL-inactive Jan 5 '14 at 17:31
• It is not true. I'm not sure whether this is homework so I'll just say that much. Look for a counterexample. There are some very simple ones! Have fun. – user119261 Jan 5 '14 at 17:49
• False, this has also been discussed on math.stackexchange.com/questions/663230/… – michek Feb 4 '14 at 14:21

## 1 Answer

Let for example $$f(x)=\frac{1}{|x|+1}.$$ Then $$\int_{-\infty}^\infty f(x)\,dx=\infty.$$