# Examples of continuous functions with compact support

I would like some simple examples of continuous functions with compact support.

I was trying to come up of a function $$\rm I\!R\rightarrow\rm I\!R$$, but compact support and continuity seem to be incompatible since if $$f$$ has compact support, which in this case I just take it to be $$[a,b]$$ for simplicity, by continuity and taking a limit from the left, we would have $$f(a)=lim_{x\rightarrow a^-}f(x)=0$$. But by construction $$f(a)\neq 0$$.

If there are no such simple examples, I have introductory knowledge on Measure Theory and Topology, so I should be able to understand some more advanced functions.

Edit to add: I was using the wrong definition for support, which gave rise to this question. I was thinking of compact support as a compact set where $$f(x)\neq 0$$.

• Welcome to Math StackExchange. How do you define "support"? Commented Oct 19, 2022 at 16:50
• Do you know of bump functions? Commented Oct 19, 2022 at 16:51
• Usually, in analysis, the support of a function is defined to be the closure of $\{x : f(x) \neq 0\}$. I think this is the only context in which you'd talk about "compact support". Commented Oct 19, 2022 at 17:07
• Sambo is correct. I didn't know about the distinction between "set theoretic support" and "support(closed support)", so I was using the wrong definition. The link resolved my question! Commented Oct 19, 2022 at 17:29
• @qbzvavba You beat me to the punch :) I just said the same thing in my answer Commented Oct 19, 2022 at 17:48

$$\newcommand{\supp}{\operatorname{supp}} \newcommand{\Csupp}{\operatorname{Csupp}}$$ There are two definitions of the support of a function. One definition, which you have given, is $$\supp(f) = \{x : f(x) \neq 0\}$$. However, the definition which is more common (especially in analysis) is the closure of this set, which I'll denote $$\Csupp(f) = \operatorname{Cl}(\{x : f(x) \neq 0\}) = \operatorname{Cl}(\supp(f))$$. This is also sometimes called the closed support of $$f$$.

If you're looking for continuous functions $$f$$ such that $$\Csupp(f)$$ is compact, there are many easy examples. For instance, take $$f(x) = 1-|x|$$ for $$x \in [-1,1]$$ and $$f(x)=0$$ otherwise.

However, you seem to be asking about continuous functions $$f$$ such that $$\supp(f)$$ is compact. Aside from the function $$f(x) = 0$$, this is indeed impossible. The proof of this is below.

Lemma. If $$f : \mathbb{R} \rightarrow \mathbb{R}$$ is continuous, then $$\supp(f)$$ is open.

Proof. Let $$x \in \supp(f)$$. Then $$f(x) \neq 0$$, so we can choose $$\epsilon>0$$ such that $$0 \notin (f(x)-\epsilon, f(x)+\epsilon)$$. By continuity, we can choose $$\delta>0$$ such that $$y \in (x-\delta, x+\delta)$$ implies $$f(y) \in (f(x)-\epsilon, f(x)+\epsilon)$$. Hence $$(x-\delta, x+\delta) \subseteq \supp(f)$$.

Corollary. If $$f : \mathbb{R} \rightarrow \mathbb{R}$$ is continuous and $$\supp(f)$$ is compact, then $$f \equiv 0$$.

Proof. If $$\supp(f)$$ is compact, then it is closed. By the lemma, $$\supp(f)$$ is therefore clopen. But the only clopen subsets of $$\mathbb{R}$$ are $$\mathbb{R}$$ and $$\varnothing$$, so $$\supp(f)$$ must be one of these. We can rule out $$\mathbb{R}$$ since it is not compact, we must have $$\supp(f) = \varnothing$$, implying $$f \equiv 0$$.

• Very clear answer. +1 Commented Oct 20, 2022 at 13:07