I'm reading a section from Santambrogio's Optimal Transport for Applied Mathematicians: Calculus of Variations, PDEs, and Modeling
Box 1.8. - Memo - Continuity of functions defined as an inf or sup
Proposition - Let $\left(f_{\alpha}\right)_{\alpha}$ be a family (finite, infinite, countable, uncountable...) of functions all satisfying the same condition $$ \left|f_{\alpha}(x)-f_{\alpha}\left(x^{\prime}\right)\right| \leq \omega\left(d\left(x, x^{\prime}\right)\right) . $$ Consider $f$ defined through $f(x):=\inf _{\alpha} f_{\alpha}(x)$. Then $f$ also satisfies the same estimate.
This can be easily seen from $f_{\alpha}(x) \leq f_{\alpha}\left(x^{\prime}\right)+\omega\left(d\left(x, x^{\prime}\right)\right)$, which implies $f(x) \leq$ $f_{\alpha}\left(x^{\prime}\right)+\omega\left(d\left(x, x^{\prime}\right)\right)$ since $f \leq f_{\alpha}$. Then, taking the infimum over $\alpha$ at the r.h.s. one gets $f(x) \leq f\left(x^{\prime}\right)+\omega\left(d\left(x, x^{\prime}\right)\right)$. Interchanging $x$ and $x^{\prime}$ one obtains $$ \left|f(x)-f\left(x^{\prime}\right)\right| \leq \omega\left(d\left(x, x^{\prime}\right)\right) . $$ In particular, if the function $\omega: \mathbb{R}_{+} \rightarrow \mathbb{R}_{+}$satisfies $\lim _{t \rightarrow 0} \omega(t)=0$ (which means that the family $\left(f_{\alpha}\right)_{\alpha}$ is equicontinuous), then $f$ has the same modulus of continuity (i.e. the same function $\omega$ ) as the functions $f_{\alpha}$. The same idea obviously work for the supremum instead of the infimum.
The author obtains $$ \left|f(x)-f\left(x^{\prime}\right)\right| \leq \omega\left(d\left(x, x^{\prime}\right)\right) . $$ Because $f$ is the infimum over a collection of functions, it is possible that $f(a) = -\infty$ for some $a$. Let $b$ be another point in the domain such that $\omega\left(d\left(a, b\right)\right) < +\infty$.
What does it mean by $\left|f(a)-f\left(b\right)\right| \leq \omega\left(d\left(x, x^{\prime}\right)\right) <+\infty$ if $f(a)= -\infty$?
The inequality $$ \tag{$*$} |f(a) - f(b)| \le \omega(d(a, b)) $$ indeed makes no sense if $f(a)$ or $f(b)$ is $-\infty$. However, that can only happen in the case that $f(x) = -\infty$ for all $x$ in the domain.
So as long as the “trivial case” $f \equiv -\infty$ is excluded, $(*)$ is well-defined and valid for all $a, b$ in the domain.
Proof of the above claim: Assume that $f(x) > -\infty$ for some $x$ and $y \ne x$. For all $\alpha$ is $$ f_\alpha(x) - f_\alpha(y) \le | f_\alpha(x) - f_\alpha(y)| \le \omega(d(x, y)) $$ and therefore $$ f_\alpha(y) \ge f_\alpha(x) - \omega(d(x, y)) \ge f(x) - \omega(d(x, y)) \,. $$ So the right-hand side is a lower bound for $f_\alpha(y)$, and it follows that $f(y) \ge f(x) - \omega(d(x, y)) > -\infty$.
This shows that there are only two possibilities: Either $f(x) = \inf_\alpha f_\alpha(x)$ is finite everywhere, or $f(x) = -\infty$ everywhere.
In the same way one can show that $s(x) = \sup_\alpha f_\alpha(x)$ is either finite everywhere, or identically $+\infty$.