Is it true that $\textrm{supp}(f)\subseteq K$ implies $f|_{\partial K}=0$? Maybe this will be an elementary question but I need to clarify this. 
Let $X$ be a metric space and let $f:X\longrightarrow \mathbb R$ continuous. Suppose $\textrm{supp}(f)\subseteq K$ where $K$ is a compact. Is it true that $f|_{\partial K}=0$? 
 A: Yes. By contradiction, suppose that $x\in\partial K$ but $f(x)\neq 0$. Then, since $x$ is on the boundary of $K$ and $f$ is continuous, there exists some $y\in K^c$ such that $f(y)\neq0$. This is impossible, since $f(y)\neq0$ would imply that $y\in\operatorname{supp}(f)\subseteq K$.

More rigorously, if $x\in\partial K=\overline K\bigcap \overline{K^c}$, then, by the definition of the closure of $K^c$, the following is true for every $\delta>0$: $$B(\delta,x)\bigcap K^c\neq\varnothing\tag{$\spadesuit$},$$
where $B(\delta,x)$ denotes the open ball of radius $\delta$ around $x$. Now $f(x)\neq 0$, so for $\varepsilon>0$ small enough, the open interval $I_{\varepsilon}\equiv(f(x)-\varepsilon,f(x)+\varepsilon)$ doesn't include zero. Since $I_{\varepsilon}$ is open in $\mathbb R$ and $f$ is continuous,
$$f^{-1}(I_\varepsilon)\equiv\{z\in X\,|\,f(z)\in I_{\varepsilon}\}$$
is open in $X$. Since $x\in f^{-1}(I_{\varepsilon})$ and $f^{-1}(I_{\varepsilon})$ is open, there exists some $\delta>0$ such that $B(\delta,x)\subseteq f^{-1}(I_{\varepsilon})$. Then $(\spadesuit)$ implies that $f^{-1}(I_{\varepsilon})\bigcap K^c\neq\varnothing$, so there exists some $y\in K^c$ such that $y\in f^{-1}(I_{\varepsilon})$, or $f(y)\in I_{\varepsilon}$. In particular, $f(y)\neq0$, establishing the desired contradiction.

Note that we don't need the compactness of $K$.
