Let $f:[a,b]\to\Bbb R$ be as follows: $f(a)=A; f(b)=B$ and $f(x)=C$ for $aConsider for real $a<b$ and real $A,B,C$, the function $f:[a,b] \to \mathbb R$ defined by
$$f(x) = \begin{cases} A & x = a \\ B & x=b \\ C & a < x < b \end{cases}$$
I want to prove that this function is integrable and has integral $$\int_a^b f = C(b-a)$$
The hint I was given was to prove this by the Archimedes Riemann Theorem, which states that if $f:[a,b] \to \mathbb R$ is a bounded function, then $f$ is integrable if and only if there is a sequence $\{P_n\}$ of partitions of $[a,b]$ s.t. the limit $\lim_{n \to \infty} [U(f,P_n)-L(f,P_n)]=0$, with $U$ and $L$ denoting the Lower and Upper Darboux sums, respectively.
 A: Hint: consider any sequence of partitions, such as
$$
\left\{a + k\frac{b-a}n  \right\}_{0\le k\le n}
$$
An explicit computation proves that
$$
U(n,f) = (n-2)\frac{b-a}n + \frac {b-a}n (\sup (A,C) + \sup (C,B))\\
L(n,f) = (n-2)\frac{b-a}n + \frac {b-a}n (\inf (A,C) + \inf (C,B))\\
$$

On the interval $[a,a + \frac{b-a}n], f(x) = A$ or $C$, and so the bounds for the integral on this interval are
$$
\left(  a + \frac{b-a}n - a \right) \min(A,C) =  \frac{b-a}n \min(A,C) , 
\frac{b-a}n \max(A,C)
$$
On the intervals $[a + k \frac{b-a}n,a + (k+1)\frac{b-a}n]$ with $0<k<n-1$
$f$ has the constant value $C$. Here both bounds are
$$
\left(  a + \frac{b-a}n - a \right) C
$$
Eventually, on the interval $[a + (n-1) \frac{b-a}n, b]$ 
$f(x) = B$ or $C$, and so the bounds for the integral on this interval are
$$
 \frac{b-a}n \min(B,C) , 
\frac{b-a}n \max(B,C)
$$
When you make the sum of these bounds, you get the upper bound
$$
U(n,f) = (n-2)\frac{b-a}n + \frac {b-a}n (\sup (A,C) + \sup (C,B))
$$
and the lower bound
$$
L(n,f) = (n-2)\frac{b-a}n + \frac {b-a}n (\inf (A,C) + \inf (C,B))
$$
