Let $f: [-\pi, \pi] \to \mathbb{R}$ be a bounded and monotonic function. Let $M > 0$ such that $|f(x)| \leq M$ for all $x \in [-\pi, \pi]$. Can $f$ be approximated (in $L^{\infty}$-sense) by a function in a form
$$\sum_{k=1}^N\alpha_k\mathbb{1}_{[a_k, a_{k+1}]}(x)$$
with $-\pi = a_1 < a_2 < \cdots< a_{N+1} = \pi$ and $|\alpha_j| \leq M$ for all $j$?
When I draw a picture of $f$, then surely we should be able to do it. But how do you write it formally? I believe you don't want the step from $f(a_1)$ to $f(a_2)$to be too large, for instance. So, we should choose $a_2$ such that $f(a_2) < \varepsilon + f(a_1)$ where $\varepsilon > 0$ is small? Any ideas or hints would be appreciated
2026-04-11 17:59:19.1775930359