Let $X$ be a locally compact Hausdorff space. Let $C_c(X)$ be the set of complex valued continuous functions of compact suppot on $X$, $C_c^+(X)$ the set of non-negative real valued functions in $C_c(X)$. Let $\Lambda$ be a positive functional on $C_c(X)$. Let $V$ be an open set of $X$. We define $\mu(V) = sup \{\Lambda f: f\le \chi_V, f\in C_c^+(X)\}$ where $\chi_V$ is the characteristic function of $V$. Let $E$ be any subset of $X$. We define $\mu(E) = inf \{\mu(V): E \subset V$ where $V$ is open$\}$. It is known that $\mu$ is a measure definded on the family of Borel sets on $X$.
Rudin wrote in his book Real and Complex Analysis, p.46 as follows.
Let $K$ be the support of $f\in C_c^+(X)$, let $[a,b]$ be an interval which contains the range of $f$, choose $\epsilon\gt 0$, and choose $y_i$, for $i = 1,\dots, n$,so that $y_i-y_{i-1} \lt \epsilon$ and $y_o\lt a\lt y_1\lt\cdots\lt y_n = b$. Put $E_i= \{x: y_{i-1}\lt f(x) \le y_i\} \cap K$, $i = 1,\dots, n$. Since $f$ is continuous, $f$ is Borel measurable, and the sets $E_i$ are therefore disjoint Borel sets whose union is $K$. There are open sets $E_i \subset V_i$ such that $\mu(V_i) \lt \mu(E_i) + \epsilon/n$ and such that $f(x) \lt y_i +\epsilon$ for all $x\in V_i$.
I don't understand the last statement.
Would anyone please elaborate on it?
$f$ is continuous and $K$ is compact, so $f(K)$ is compact. We can take $a=0$ and $b = \sup_{x \in K} f(x)$.
This is just an arbitrary partition of $[a,b]$. The $y_0$ has probably been chosen this way for uniformity.
One could write $F_i = \{ x \in X : f(x) \le y_i \} = f^{-1}(]-\infty,y_i])$ which is closed in $X$, so since $K$ is compact and $X$ is Hausdorff, $F_i$ is compact. Note that $F_i$ is closed, hence Borel measurable, so that $E_i = F_i \backslash F_{i-1}$ is Borel measurable.
The description $E_i = \{ x \in X : y_{i-1} < f(x) \le y_i \}$ makes this clear (for the disjointness part).
There exists an open set $V_i$ with $\mu(E_i) \le \mu(V_i) < \mu(E_i) + \varepsilon/n$ by definition of $\mu(E_i)$ as an infimum. If $E_i \subseteq V_i' \subseteq V_i$ is an open set in between, then we can replace $V_i$ by $V_i'$ and still preserve our inequality. Therefore we let $V_i' \overset{def}= V_i \cap f^{-1}(]-\infty,y_i+\varepsilon[)$. The inclusion $E_i \subseteq f^{-1}(]-\infty,y_i + \varepsilon[)$ follows by definition of $E_i = F_i \backslash F_{i-1}$.
Hope that helps,