TITLE: why compact support implies a function vanished at boundaries?
QUESTION [7 upvotes]: "A function has compact support if its support is a compact set."
While support of a function $u:G\rightarrow\mathbb{R}$ is defined to be
$supp(u)=\overline{\{x:G|u(x)\neq0\}}$
But lately, Another statement said that
"if a function has compact support, it vanished at boundaries of its domain".
So, how this implication come up? is there anyone can proof it?
Thanks

REPLY [15 votes]: Suppose that $G$ is an open subset of $\mathbb R^n$, and that $f: G \to \mathbb R$ has compact support.  Then there is a compact subset $K \subset G$ such that
$f$ vanishes on $G\setminus K$.  Since $F:= \mathbb R^n \setminus G$ is closed, and $K$ is compact,
the distance between any point of $K$ and $F$ is bounded below by some $\epsilon >0$.  In particular, at any point of $G$ that is within distance $\epsilon$ of $\partial G$, the function $f$ will be zero (since such a point lies outside $K$).

Note that we can't literally evaluate $f$ at points of $\partial G$, since these
don't lie in $G$, so the statement that $f$ vanishes on the boundary of $G$ should be understood in a slightly figurative sense.
On the other hand, if $f$ were continuous, or smooth, and we extended $f$ to all of $\mathbb R^n$ by defining it be zero on $F$, this extended function would continue to be continuous, or smooth, and would vanish on $\partial G$.