Let $X$ be a locally compact Hausdorff space. Let $K$ be a compact subset of $X$. Let $f$ be a non-negative real-valued continuous function with a compact support such that $\chi_K \le f$ where $\chi_K$ is the characteristic function of $K$.
Is there a continuous function $g$ with a compact support such that $g(x) = 1$ on $K$ and $0\le g \le 1$ and $g\le f$?
The motivation is as follows. Suppose $K \subset U_1\cup \dots \cup U_n$ where $U_i$ is open. I want to prove that there exist non-negative continuous functions of compact support $h_1,\dots, h_n$ such that $h_1(x) + \cdots + h_n(x) = 1$ on $K$ and $0\le h_i \le 1$ and the support of $h_i \subset U_i$.
It is well known that there exist compact sets $K_i$ such that $K = \cup K_i$ and $K_i \subset U_i$ for each $i$(see for example Halmos's Measure Theory). It is also well-known that there exist continuous functions of compact support $f_i$ such that $f_i(x) = 1$ on $K_i$ and $0\le f_i\le 1$ and the support of $f_i$ is contained in $U_i$ for each $i$. Let $f = f_1 + \cdots + f_n$. Suppose there exists a continuous function $h$ such that $h(x) = 1$ on $K$ and $0\le h \le 1$ and $h \le f$. Definie $h_i(x) = f_i(x)h(x)/f(x)$ when $f(x)$ is not $0$, $h_i(x) = 0$ otherwise. Since $h_i\le h\le f$, $h_i$ is continuous. Hence $h_i$'s satisfy the aforementioned conditions.