Below is the graph of a two variable bounded function from $[0,1]\times[0,1]$ that has discontinuities at the boundary of the unit disk.
Below is a picture explaining why we can arrange the upper and lower sums to be as close to each other as we wish. The key ingredients are:
- The set of discontinuities can be covered by finitely many open intervals with total area as small as desired. The resulting contribution to the difference between the upper and lower sums is upper bounded by the (hyper)volume of the orange pillars.
- Elsewhere the function is uniformly continuous, and we can make the suprema/infima on the intervals to be as close to each other as we wish by using a dense enough subdivision. Their contribution to difference between the upper/lower sums is bounded from above by the (hyper)volume of the green boxes.
If we use a denser subdivision, the orange pillars become thinner, and the green boxes become flatter $\implies$ their combined volume $\to0$.
This proof shows that any bounded function with discontinuities in a Jordan null set is Riemann-integrable. If you milk everything out of the idea you get the same for functions with discontinuities in a Lebesgue null set.