In a proof of the Riesz Representation Theorem, one has the following construction:
Let $X$ be a locally compact Hausdorff space and $f\in C_c(X,[0,1])$. Define open sets for fixed $n$ $$ G_j=\left\{x\in X: f(x)>\frac{j-1}{n}\right\}, j=1,2,\cdots, n, n+1 $$ and $$ f_j(x)=\begin{cases} 0,& x\not\in G_j\\ \min\{nf(x)-j-1,j\},& x\in G_j \end{cases} $$ We have then $$ f=\frac{1}{n}(f_1+f_2+\cdots+f_n)$$ and $$1_{\overline{G_{j+1}}}\leq f_j\leq 1_{G_j} $$
What is the intuition of the definition of $f_j$?