# $L^p$ function that has no compact support

I understand an $L^p$ function have in them as a dense subset the set of functions with compact support. But do there exist $L^p$ functions that do not have compact support. What are some examples for elementary cases like $p=1,\ldots$?

I hope I am not going in circles here, but I think my question is sensible. Although rationals are dense in reals, the two are still distinct. In the same way, although functions with compact support are dense in $L^p$ space, there should exist $L^p$ functions without compact support. Thanks!

-
$x \mapsto e^{-x^2}$ – Alexander Thumm Nov 8 '11 at 8:24
Is support actually a well-defined notion for elements in $L^p(\mathbb R)$? Is there such a thing as an essential support? – Rasmus Nov 8 '11 at 8:41

As @Rasmus said, the definition of the support of a function in $L^p(\mathbb R^n)$ is more complicated than $\overline{\{x\in\mathbb R^n: f(x)\neq 0\}}$, since an $L^p$ function is only an equivalence class of function which are equal almost everywhere, and the last definition won't work, since two functions of the same class would have a different support.
The good definition is to consider $O:=\bigcup_{\omega\in\Omega}\omega$ where $\Omega$ is the collection of the open subsets of $\mathbb R^n$ such that $f(x)=0$ for almost every $x$ in $\omega$. We can show that we have $f(x)=0$ for almost every $x\in O$ (we can write $O$ as a countable union of compact sets, and each compact is a finite union of $\omega\in\Omega$, hence $O$ can be written as a countable union of $\omega\in\Omega$, and the result follows). Now we can define the support of a function $f\in L^p(\mathbb R^n)$ as the complement in $\mathbb R^n$ of $O$. You can show that if $f$ is continuous, the two definition of support are the same, and @AlexanderThum's counter-example show that there are functions in $L^p(\mathbb R^n)$ which do not have a compact support (hence the support is not at all conserved taking a limit in $L^p$).