Given $n$ smooth real functions $f_1, f_2, \dots, f_n$, define a composite function like this:
$$f(x) = \max(f_1(x), f_2(x), \dots, f_n(x)) - \min(f_1(x), f_2(x), \dots, f_n(x))$$
Is it possible to say anything useful in general about the shape of this function?
Intuitively, it seems like $f$ will be at least $C^0$ continuous but $f^\prime$ may have arbitrarily many discontinuities. How much would we have to know about the individual $f_k$ to be more specific?
For example, if we know that each $f_k$ has $m_k$ extrema, it seems like we should be able to place bounds on both the number of extrema in $f$ and number of discontinuities in $f^\prime$, but I'm having trouble visualising all the possible interactions as $n$ increases.
(I've tried to put this in general terms, but for context my particular interest is somewhat related to my earlier optics question. A different but similar imaging process produces something like the above function with constituent $f_k$ of this form:
$$f_k(x) = \sum_i e_i \sin(x_i + \frac{2k\pi}{n}) P(x - x_i)$$
Once again, simulations suggest that this process can noticeably improve lateral resolution because of the corners introduced between maxima, but it would be nice to have a more formal characterisation.)