On the proof of $\mu(U)-\mu(K)<\epsilon$ and $\chi_K\le f\le\chi_U$ 
Let $(X,\tau,\mathcal A,\mu)$ a space that satisfy hypothesis $(H)$. Prove that for all compact $K\subseteq X$ and $\epsilon>0$, exist $f\in C_c(X)$ such that $f(x)=1,\forall x\in K$ and $\mu(K)\le\int_\limits Xfd\mu<\mu(K)+\epsilon$. 

By Henno Brandsma first lines answer we have an open set $U$ such that $K\subseteq U$ and $\mu(U)-\mu(K)<\epsilon.....(*)$
Now seems natural to try to apply Urysohn's lemma because we have all the hypotheses required. We then have $f\in C_c(X)$ such that $0\le f\le1$ and $f=1$ in $K.$ Also by the Lemma $\chi_K\le f\le\chi_U$.
$\implies\int\chi_K\le\int f\le\int\chi_U$
$\implies\mu(K)\le\int f\le\mu(U)$
By $(*)$ this implies $\implies\mu(K)\le\int f\le\mu(U)<\mu(K)+\epsilon$.
Is the proof correct?
If it is, why $\mu(U)-\mu(K)<\epsilon$ ? and 
why $\chi_K\le f\le\chi_U$? 
I am also having dificulties with the definition of the characteristic functions. My understanding is that $\chi_K=\begin{cases}1,x\in K\\0,x\in K^c\end{cases}$ and $\chi_U=\begin{cases}1,x\in U^c\\0,x\in U\end{cases}$
However this would lead to $1\le f\le 0$ when $x\in K,x\in U$ which does not looks right :(
Could someone help me out please? I would appreciate help. Thank you in advance.
----
Hypothesis $(H)$
1.$(X,\mathcal A,\mu)$ is a measurable space
2$.(X,\tau)$ is a topological locally compact Hausdorff space
3.$\mu$ is complete
4.if $K\subseteq X $ is compact then $\mu(K)<\infty$
5.$\mathcal B(X)\subseteq \mathcal A$
6.if $E\in\mathcal A$ then $\mu(E)=\inf\{\mu(U)\mid U \text{ is open},E\subseteq U\}$
7.if $E\in\mathcal A$ with $\mu(E)<\infty$ or $E\in\tau$ then $\mu(E)=\sup\{\mu(F)\mid  F \text{ is closed},F\subseteq E\}$
 A: $\mu(K)=\inf \{\mu(U): U \text{ open }, K \subseteq U\}$ by 6. for the finite $\mu(K)$ (by 4). Then $\mu(K)+\epsilon$ is strictly larger than the infimum above, which is the largest lower bound of that set of measures, so there is some $U$ that witnesses that $\mu(K) + \epsilon$
is not a lower bound for the set, so (!) there is some open superset of $K$ we call $U$ such that $\mu(U) < \mu(K)+\epsilon$. And $\mu(K) \le \mu(U)$ is obvious. So $\mu(U) \in [\mu(K), \mu(K)+\epsilon)$ and this is what you need.
So it's a matter of realising what the infimum property means, really.

Your $\chi_U$ is the other way around: it's $1$ on $U$, $0$ on $U^\complement$, like $\chi_K$!
As $f=1$ on $K$ and $0 \le f \le 1$, $\chi_K \le f$ is clear.
If $x \notin U$, $f(x)=0$ so $x \in U^\complement \implies f(x)=\chi_U(x)=0$ and also $x \in U \implies f(x) \le 1=\chi_U(x)$ 
In both cases, $f$ and the characteristic function agree on one half of the domain and on the other the fact that $0 \le f \le 1$ ensures an inequality for the other half.
