# Question related to Riemann sums, sups, and infs of bounded functions

Can someone give me an example of a bounded function $f$ defined on a closed interval $[a,b]$ such that $f$ does not attain its sup (or inf) on this interval? Obviously, $f$ cannot be continuous, but for whatever reason (stupidity? lack of imagination?) I can't think of an example of a discontinuous, bounded function for which $\sup\limits_{x\in [a,b]} f(x) \neq \max\limits_{x\in [a,b]} f(x)$.

lavinia
Gold Member
Can someone give me an example of a bounded function $f$ defined on a closed interval $[a,b]$ such that $f$ does not attain its sup (or inf) on this interval? Obviously, $f$ cannot be continuous, but for whatever reason (stupidity? lack of imagination?) I can't think of an example of a discontinuous, bounded function for which $\sup\limits_{x\in [a,b]} f(x) \neq \max\limits_{x\in [a,b]} f(x)$.

f(x) = x except at the end points where it equals (a+b)/2

Hmmm...I think I may have just thought of one! On $[0,1]$, define $f(1) = 0$, and let
$$f(x) = \sum_{n = 0}^\infty \frac{n}{n+1} \chi_{\left[ \left. \frac{n}{n+1},\frac{n+1}{n+2} \right) \right.}(x).$$
Then $f(x) \leq 1$ for all $x$, $\sup\limits_{x\in[0,1]} f(x) = 1$, but $f(x) \neq 1$ for all $x\in [0,1]$. And, if I'm not mistaken, $f$ is still Riemann integrable, since there are only countably many points at which it is discontinuous. Can someone confirm if this is actually true?

f(x) = x except at the end points where it equals (a+b)/2
This is much easier than my example. Thanks!