Continuity of max (moving the domain and the function) Let $f:\mathbb{R}\times[0,1]\to\mathbb{R}$ continuous and $c:\mathbb{R}\to[0,1]$ continuous.
Consider
$$F:\mathbb{R}\to\mathbb{R},\ \ F(x)=\max_{t\in[0,c(x)]}f(x,t)$$
Is $F$ continuous? I believe it is true, but I've difficulties to prove it.
I managed to prove that fixing the parameter in one of the two places then the obtained function is continuous, i.e.
$$x\mapsto\max_{t\in[0,c(x_0)]}f(x,t) \qquad\text{and}\qquad x\mapsto\max_{t\in[0,c(x)]}f(x_0,t) \qquad\text{are continuous.}$$
But now it seems not trivial to conclude by the triangle inequality...
 A: Note that the set $C:=\{(x,t)\mid x\in\Bbb R,\ t\in[0,c(x)]\}$ is closed and contains the graph of $c$, the set $G(c) = \{(x,c(x))\mid x\in\Bbb R\}$, which is closed in $\Bbb R \times [0,1]$
Show that the preimage of an open subbase set $(-\infty,a)$ under $F$ is open: This is the set $\Bbb R-\{x\mid \exists t\le c(x),f(x,t)\ge a\}$. The complement can be expressed as $\pi_{\Bbb R}(f^{-1}([a,\infty)\cap C)$. Since $[a,\infty)$ is closed, its preimage under $f$ is closed. But if we now apply the projection $\pi_{\Bbb R}$, we get a closed set again. This is because the projection $X\times Y\to X$ is closed if $Y$ is compact, so it is in the case $\Bbb R\times[0,1]\to\Bbb R$.
Still, there is a problem if we want to apply the same argument to an open subbase set $(a,\infty)$ since the restriction of an open map, like the projection, to a closed subset isn't necessarily open. In this case, however, $\pi_{\Bbb R}|_C$ is indeed open. This is obvious on $C\setminus G(c)$. And on $G(c)$, we have $\pi_{\Bbb R}((U×V)\cap G(c))=c^{-1}(V)\cap U$.
A: Hint: If $c(x)=c_0 \in (0,1)$ then it may be that $f$ has a value exceeding $f(c_0)$ which occurs at some $x<c$. In this case a small movement of $x$ will only move $c(x)$ near $c_0$ so the max will stay the same. 
On the other hand it may be that $f$ has its maximum value on the interval $[0,c_0]$ of $f(c_0)$ i.e. it is maximal at $c(x)=c(x_0).$ In this case as $x$ moves near $x_0$ it may either cause $c(x)$ to go back down below $c(x_0)$, or move $c_(x)$ above $c_0$, but either way the continuity of $f$ should keep the max from jumping.
