Our situation:
We have a a function $f$ that is continuous on [0,1] and $M=\max\{f(x) : x \in [0,1]\}$.
We WTS that either f is constant ($\forall x \in [0,1] \space f(x)=M$) or that $\int_{0}^{1} f(t) \, dt < M.$
Intuitively I know this is true but it becomes a bit harder to prove. This is what I have so far:
Firstly f can be the function $g(x)=M$ because g is continuous and non-neg on [0,1] and M is naturally the maximum of $g$ on $[0,1]$.
The harder part is if $\exists x \in [0,1]$ such that $f(x) < M$ (f is not constant):
Since f is continuous it is Riemann integrable which means if $U(f)$ is the upper integral of $f$ on $[0,1]$ ($U(f) = inf\{U(f,P) : P \in X\}$ where $X$ is a collection of all partitions of $[0,1]$ and $U(f,P)$ is a upper sum) then $U(f) = \int_{0}^{1} f(t) \, dt.$ (This is probably the part I am least confident about)
Let P be a partition of [0,1] then $U(f,P)= \sum_{i=0}^{k-1} M_i(a_{i+1} - a_{i})$ where $M_i$ is the supremum of $f$ on that interval. Then $U(f,P)< M\sum_{i=0}^{k-1}(a_{i+1} - a_{i})=U'(f,P).$ Note that we have a strict less than because f is not constant.
Then we have $\int_{0}^{1} f(t) \, dt = U(f) \leq U(f,P) < U'(f,P)=M$ which means $\int_{0}^{1} f(t) \, dt < M$.
Does this proof look ok?
If $f$ is not constant, then there exists an $x_0\in (a,b)$, such that $$ f(x_0)<\max_{x\in [a,b]} f(x)=M $$ If we set $2\varepsilon=M-f(x_0)$, then there exists a $\delta>0$, such that $$ |x-x_0|<\delta \quad\Longrightarrow\quad |f(x)-f(x_0)|< \varepsilon=\frac{1}{2}\big(M-f(x_0)\big) \quad\Longrightarrow\quad |f(x)-f(x_0)|<\frac{1}{2}M-\frac{1}{2}f(x_0) \quad\Longrightarrow\quad f(x)<\frac{1}{2}M+\frac{1}{2}f(x_0) =M-\varepsilon $$ Hence $$ \int_a^b f=\int_a^{x_0-\delta} f+\int_{x_0-\delta}^{x_0+\delta} f+\int_{x_0+\delta}^b f \le (x_0-\delta-a)M+2\delta (M-\varepsilon)+(b-x_0-\delta)M \\=(b-a)M-2\delta\varepsilon<M. $$