Let$$f: [0,7] \to \mathbb{R}, f(x) = \begin{cases} 5 , 0 \le x < 4 \\ 0, x = 4 \\ 4, 4 < x \le 7\end{cases}$$ Consider the partition $\lbrace 0, 4 - \frac{1}{n}, 4 + \frac{1}{n}, 7\rbrace$ Show that for every $\epsilon > 0$, there exists $n \in \mathbb{N}: U(f, Pn)- L(f, Pn) < \epsilon$ and hence, f is integrable on $[0, 7]$
I have the following:$$U(f,P) = \sum_{i=1}^n M_i\Delta x_i = 5\sum_{i=1}^n\Delta x_i = 5 \cdot ((4 - \frac{1}{n} - 0) + (4 + \frac{1}{n} - (4 - \frac{1}{n})) + (7-(4 - \frac{1}{n}))) = 5\cdot (7 + \frac{2}{n})$$ and $$ L(f,P) = \sum_{i=1}^n m_i\Delta x_i = 4\sum_{i=1}^n\Delta x_i = 4 \cdot ((4 - \frac{1}{n} - 0) + (4 + \frac{1}{n} - (4 - \frac{1}{n})) + (7-(4 - \frac{1}{n}))) = 4\cdot (7 + \frac{2}{n})$$. Is this correct? I don't know what to do from here. Any help would be appreciated.
The only difference between your upper sum and your lower sum is across the jump at 4. To calculate the upper sum, break it up into the 3 parts. On the first part you have both upper and lower sum having the same value of $5\cdot (4-\frac 1 n)$ Similarly, on the third part you have both upper and lower sum having $4\cdot (7-(4+\frac 1 n))$ Thus, $U(f,P_n)-L(f,P_n)$ will be exactly the difference across the jump discontinuity.
The upper sum has a max of 5 in the width $\frac 2 n$, for a total of $\frac {10} n$. The lower sum has a min of 0 in that width, so has a total of 0. Thus $U(f,P_n)-L(f,P_n)=\frac {10} n$. Now just pick $n>\frac {10} \epsilon$.