Let $f : [a; b] \to \mathbb R$ defined by $$f(x) = \begin{cases} c, & x=a \\ d, & a \lt x \lt b\\ e, & x=b \end{cases}$$ Assuming $c \lt d \lt e$, show that $f$ is integrable into $[a, b]$ and that $$ \int_a^b f = d(b-a).$$
My attempt:
Let $P: a=t_0 + t_1 + ... + t_{n-1} + t_n = b$ then
$ \sum_{j=1}^n w_j(t_j - t_{j-1}) = w_1(t_1 - a) + w_2(t_2 - t_1) + w_3(t_3 - t_2) + ... + w_j(b- t_{j-1}) $ but
$w_2 = w_3 = ... = w_{j-1} = 0$ and
$ w_1 = (d-c), w_j = (e-d)$ so
$ \sum_{j=1}^n w_j(t_j - t_{j-1}) = (d-c)(t_1 - a) + (e-d)(b- t_{j-1}) $
now, given a $\epsilon \gt0$ there is a partition $P$ of $[a,b]$ such that
$(d-c)(t_1 - a) + (e-d)(b- t_{j-1}) = \sum_{j=1}^n w_j(t_j - t_{j-1}) \lt \epsilon$
given a $ \ epsilon$ choose $t_1 \lt a$ such that $(d-c)(t_1 - a) \lt \frac{\epsilon}{2}$ and
$t_{n-1} \lt b$ such that $(d-c)(t_1 - a) \lt \frac{\epsilon}{2}$.
Thus, if $P = \{a, t_1, t_{n-1}, b \}$ then $P$ is a partition of $[a,b]$
$\sum_{j=1}^n w_j(t_j - t_{j-1}) = (d-c)(t_1 - a) + (e-d)(b- t_{j-1}) \lt \frac{\epsilon} {2} + \frac{\epsilon}{2} = \epsilon$
As it is integrable, then the upper integral and the lower integral are equal, so using the lower integral we have:
$$ \int_{a}^b f = \sup s(f;p) = \sum_{j=1}^n m_j(t_j - t_{j-1}) = \sum_{j=1}^n d(b-a) = d \sum_{j=1}^n (b-a) = d(b-a)$$
Any help is greatly appreciated.

For integrability, given $ \epsilon>0 $, consider the partition $ P : $ $$(a=t_0, a+\frac{\epsilon}{2(d-c)}=t_1,b-\frac{\epsilon}{2(e-d)}=t_2,b=t_3)$$
then, if $ L(f,P) $ and $ U(f,P) $ are the lower and upper Darboux sums, we have
$$U(f,P)-L(f,P)=\frac{\epsilon}{2}+\frac{\epsilon}{2}$$
For the value of the integrale,
the function$$ F :x\mapsto \int_{\frac{a+b}{2}}^xf(t)dt $$ is continuous, thus
$$\int_a^bf(t)dt=\lim_{x\to 0}\int_{a+x}^{b-x}f(t)dt$$
$$=\lim_{x\to 0}d(b-2x-a)=d(b-a)$$