Let $f:S\rightarrow \mathbb{R}$ where $S=[x,y]$. I am looking for references on the following property.
There is $k\in\mathbb{N}$ such that $\forall v\in \mathbb{R}$ there exists $a_1\leq...\leq a_{2k}\in S$, such that $\{z:f(z)=v\}=\cup^k_{n=1}[a_{2n-1},a_{2n}]$.
Basically the level sets of $f$ are a collection of intervals where the number of intervals are uniformly bounded.
Would smoothness work? I suppose the issue is that smooth humps can get infinitesimal.
Smoothness itself won't work, consider something like $f: [0, 1] \to \mathbb{R}$, $f(x) = \sin(1/x) e^{-\frac{1}{x^2}}$. This is (I think) smooth at $0$ (and also of course everywhere else too), but $f^{-1}(0)$ is infinite set.
Something like $C^1$ + the first derivative has only finitely many zeroes might probably work though.