TITLE: How to show that this function is continuous?
QUESTION [5 upvotes]: Let $\psi(x,y)$ be a continuous function in two real variables, and then define
$$f(x) = \sup_{t \in [-x,x]} \psi(x,t)$$
It seems to me that the function $f$ should also be continuous for $x \geq 0$, but I'm not sure how to prove it. Is this true and how would you prove it?

REPLY [2 votes]: HINT: use uniform continuity.
Fix $x_0$ and let $\epsilon > 0$. Choose $t_0 \in \left[-x, x\right]$ such that $f(x_0) = \psi(x_0, t_0)$. Since $\psi$ is continuous, there exists a $\delta > 0$ such that
$$|\psi(x, t) - \psi(x_0, t_0)| < \epsilon$$
for all $(x, t)$ in the closed ball of radius $\delta$ (let's say with respect to the norm $\|\cdot\|_\infty$) centered on $(x_0, t_0$).
Hence
$$f(x) \ge \psi(x, t_0 - \operatorname{sgn}(t_0)\delta) > f(x_0) - \epsilon$$
for all $x$ such that $|x - x_0| < \delta$ (note that $t_0 - \operatorname{sgn}(t_0)\delta \in [-x, x]$).
Let $M \gg x_0$. By compactness and continuity, $\psi$ is uniformly continuous on $E = [-M, M] \times [-M, M]$. Thus we could have chosen $\delta$ to be the "universal delta" for $\psi$ over $E$.
Hence, analogously,
$$f(x_0) > f(x) - \epsilon$$
and therefore $|f(x) - f(x_0)| < \epsilon$.