I'm having trouble with an exercise in W.A. Sutherland's "Introduction to Metric and Topological Spaces" 1st Edition (Oxford Science Publications, 1975), Chapter $2$, Exercises $2.6: 25$.
Let $\mathscr C [a, b]$ be the set of all continuous real functions $f: [a, b] \to \mathbb R$, where $[a, b]$ denotes the closed real interval from $a$ to $b$: $[a, b] = \{x \in \mathbb R: a \le x \le b\}$.
Let $d: \mathscr C^2 \to \mathbb R$ be the supremum metric on $\mathscr C [a, b]$ defined as:
$\displaystyle \forall f, g \in \mathscr C: d (f, g) := \sup_{x \mathop \in [a, b]} |f(x) - g (x)|$
where $\sup$ denotes the supremum function.
Let $f, g \in \mathscr C [a, b]$ be such that $\forall x \in [a, b]: f(x) < g(x)$
Consider the set $S$, defined as:
$S = \{h \in \mathscr C [a, b]: \forall x \in [a, b]: f(x) < h(x) < g(x)\}$
Is $S$ an open ball of $(\mathscr C [a, b], d)$?
The answer given is that $S$ is an open ball of $(\mathscr C [a, b], d)$ if and only if $g(x) - f(x)$ is constant.
Proving the necessary condition is straightforward: if $g(x) - f(x)$ is constant, then $S$ is the open ball whose center is $\rho$ defined such that $\rho(x) = f(x) + \dfrac {g(x) - f(x)} 2$. Proving this is an open ball is easy.
Going the other way is a little more difficult.
This is what I've done so far.
Let it be assumed that $S$ is an open ball.
Then there exists $\phi \in \mathscr C [a, b]$ and $\epsilon \in \mathbb R_{>0}$ such that $B_\epsilon(\phi) = S$.
That is:
$$\forall \rho \in S: \sup_{x \mathop \in [a, b]} | \rho (x) - \phi (x) | < \epsilon$$
Aiming for a contradiction, suppose it is not the case $f$ and $g$ are such that $\forall x \in [a, b]: g(x) - f(x) = c$ for some constant $c \in \mathbb R$.
Then $$\exists \xi, \zeta \in [a, b]: g (\xi) - f (\xi) > g (\zeta) - f (\zeta)$$
Then: $$\sup_{x \mathop \in [a, b]} |g (x) - f (x)| \ge g (\xi) - f (\xi) > g (\zeta) - f (\zeta)$$
As $f$ and $g$ are continuous:
$$\exists (p, q) \subset [a, b]: \forall x \in (p, q): |g (x) - f (x)| > g (\zeta) - f (\zeta)$$
Let $h \in S$ such that:
$$\exists r, s \in (p, q): |h(r) - h(s)| > g (\zeta) - f (\zeta)$$
That is, in the interval $(p, q)$, the oscillation on $h$ is greater than the minimum distance of $g - f$.
The intention is to prove that $h$ cannot be in the open ball that is $S$, but I've lost the train of my thinking and I can't see my way through to the end.
Can someone guide me out of the woods?
Suppose that $g-f$ is not constant. Take $h\in S$ and $r>0$ such that $B_r(h)\subset S$; I will prove that $B_r(h)\varsubsetneq S$. Take $N\in\Bbb N$ such that $\frac1N<r$. For each $n\geqslant N$, let $g_n=h+r-\frac1n$. Then $g_n\in B_r(h)$ and therefore $g_n\in S$, which implies that $(\forall x\in[a,b]):g_n(x)<g(x)$. But then, for each $x\in[a,b]$,\begin{align}h(x)+r&=\lim_{n\to\infty}h(x)+r-\frac1n\\&=\lim_{n\to\infty}g_n(x)\\&\leqslant g(x).\end{align}By a similar argument,$$(\forall x\in[a,b]):h(x)-r\geqslant f(x)$$and therefore$$(\forall x\in[a,b]):g(x)-f(x)\geqslant2r.$$But $g-f$ cannot be the constant function $2r$ and so there is some $x_0\in[a,b]$ such that $g(x_0)-f(x_0)>2r$. So, you must have $g(x_0)>h(x_0)+r$ or $f(x_0)<h(x_0)-r$ (or both). If$$g(x_0)>h(x_0)+r,\tag1$$then the function $g-h$ is continuous, it is always greater than or equal to $r$, and $(1)$ holds. Take $k<g(x_0)-h(x_0)-r$ and such that $g-k>f$. Then $g-k\in S$. But $g-k\notin B_r(h)$, since $g(x_0)-k-h(x_0)>r$.