Prove that if $f$ is continuous on $[a,b]$ and exists a partition $P$ such that $S(P)=\sum_{i=1}^{n}M_i \Delta x_i=\int_{a}^{b} f$ then $f$ is constant on $[a,b]$.
I have no idea where to actually start other that if we assume that $f$ isn't constant, then there's a segment $[x_i,x_{i-1}]\subseteq[a,b]$ in which $M_i>m_i$.
First, we prove that if $S(P)=\int_a^bf$ and $f$ is continuous, then $f$ is a step function.
To see this, pick an interval $[x_i,x_{i+1}]$ determined by the partition. Since $S(P)=\int_a^bf$, we must have $M_i(x_{i+1}-x_i)=\int_{x_i}^{x_{i+1}}f$. With effect, note that $$\int_{x_i}^{x_{i+1}} (M_i-f(x))dx \geq 0,$$ so $M_i(x_{i+1}-x_i) \geq \int_{x_i}^{x_{i+1}} f$. Since this holds for every interval, if one of them was strictly greater the sum would be as well (recall that $S(P) \geq \int_a^b f$), yielding a contradiction since we have $S(P)=\int_a^b f$.
It follows that $\int_{x_i}^{x_{i+1}}(M_i-f(x))dx=0.$ Since the input is a continuous non-negative function, this implies that $M_i-f(x)=0$ for all $x$ in $[x_i,x_{i+1}]$. Since the interval is arbitrary, this proves that $f$ is a step function.
But a continuous step function (on an interval) must be constant.