Existence of a continuous selector for a continuous optimization problem
Suppose that you have a continuous function $$ S \colon \mathbb{R}\times [0, 1]\to [0, \infty).$$ Define an auxiliary function $$S^\star(x)=\max_{t\in[0,1]}S(x, t).$$ Does there exist a continuous function $t(x)$ such that $$S^\star(x)=S(x, t(x))?$$
Solution 1:
Not necessarily. Consider a zig-zag function
$$h \colon \mathbb{R} \to \mathbb{R};\qquad h(x) = \operatorname{dist}(x,\mathbb{Z})$$
and
$$S(x,t) = h(x-t)$$
The $t$ that maximises $S$ for a given $x$ slides and jumps from one end of the interval to the other for $x = k + \frac{1}{2}$, $k \in \mathbb{Z}$.
For $0 \leqslant x < \frac{1}{2}$, we uniquely have $S^*(x) = S(x, x+\frac{1}{2})$, and for $\frac{1}{2} < x \leqslant 1$ we uniquely have $S^*(x) = S(x, x - \frac{1}{2})$.
Solution 2:
This falls into the problem of a measurable selection. There may not be a continuous function that realizes the maximum. As an example, consider a case of bang-bang problem: $$ S(x,t) = xt. $$ If $x\geq 0$ then $\max_tS(x,t) = x$ at $t=1$. If $x<0$, then $\max_tS(x,t) = 0$ at $t=0$. In general, the existence of a continuous selector is a very rare case even under very strong assumptions. However, there are a lot of results for the existence of measurable selectors which are often also ok to deal with.
Edited: In the previous version I've made a statement that there are result on the existence of semi-continuous selectors. Actually, that's not really true - in fact they can only guarantee the semi-continuity of $S^\star$, but not that of $t(x)$. Anyways, for measurable selectors very nice results can be found in the Chapter 7 of this famous book, you can get it from the link.
In particular, Proposition 7.33 and 7.34 apply in case when $S$ is semi-continuous and guarantee the existence of Borel-measurable selector, whereas Proposition 7.50 assures the existence of the universally measurable selector if $S$ is only Borel-measurable (or, more generally, semi-analytic).