Let $P=[a_1,b_1]\times\cdots\times[a_n,b_n]$ be a rectangle, $x\in P.$
Definition Let $f:P\to \mathbb{R}$ be a bounded function,then define the amplitude of function $f$ at the point $x$ as $$\omega_f(x):=\lim_{r\to 0+}\sup\left\{|f(x_1)-f(x_2)|:\ x_1,x_2\in B(x,r)\cap P\right\}.$$ Here $B(x,r)$ represents the open ball centered at point $x$ with a radius of $r.$
If we define the function $$B:P\to \mathbb{R},\ x\mapsto \lim_{r\to 0+}\sup_{a\in B(x,r)\cap P} f(a),$$ and function $$A:P\to \mathbb{R},\ x\mapsto \lim_{r\to 0+}\inf_{a\in B(x,r)\cap P} f(a),$$ then we can see $$\omega_f(x)=B(x)-A(x),\ \forall\ x\in P.$$ So each interval $[A(x),B(x)]$ corresponds to the amplitude of function $f$ at the point $x$.
Define the Supremum and infimum of function $f$ as $$m:=\inf_{x\in P} f(x),\ M:=\sup_{x\in P} f(x),$$ then I can guess that there is $$[m,M]\subset\bigcup_{x\in P} [A(x),B(x)].$$
In fact, I'm planning to use this conclusion to prove a theorem about Riemann integral($f$ is Riemann-integrable iff the region under its graph is Jordan-measurable),but I meet great difficulties in proving this conclusion, since I don't have enough analytical techniques.
Question: Prove that $$[m,M]\subset\bigcup_{x\in P} [A(x),B(x)].$$ Any hint is also welcomed.
I. Show $[m,M] \supset \cup_x [A(x),B(x)]$
Take any $y\in \cup_x [A(x),B(x)]$. Then it must be in $[A(x),B(x)]$ for some $x$.
Hence, for any $y\in\cup_x [A(x),B(x)]$, there is an $x$ such that: $$\inf_x f(x)\leq \lim_{r\rightarrow0}\inf_{z\in B_r(x)} f(z)\leq y \leq \lim_{r\rightarrow0}\sup_{z\in B_r(x)} f(z) \leq \sup_x f(x).$$
Thus $y\in[m,M]$.
So we have that $[m,M] \supset \cup_x [A(x),B(x)].$
II. Show $[m,M] \subset \cup_x [A(x),B(x)]$
Assume that $y\in[m,M]$ and the contrary that $\forall x$ either $y<A(x)$ or $B(x)<y$. So we can partition $P$ into two subsets $X_a$ and $X_b$ where $y<A(x)$ for $x\in X_a$ and $B(x)<y$ for $x\in X_b$ with $P=X_a\cup X_b$.
We have that $m=\min\{ \inf_{X_a}f, \inf_{X_b} f \}$ and $M=\max\{ \sup_{X_a}f, \sup_{X_b} f \}$.
Assuming that neither $X_a$ nor $X_b$ is empty, we get that $$m=\inf_{X_b}f\leq\sup_{X_b}f<y<\inf_{X_a}f \leq\sup_{X_a}f =M$$
But $P$ is connected so we can find $z\in\overline{X}_b\cap X_b$ (without loss of generality) such that $B_r(z)\cap X_a \neq \emptyset$ and $B_r(z)\cap X_b \neq \emptyset$ for all $r$. I.e. one of the partition sets contains a point on its "inner boundary" with the other partition set. This implies that $A(z)\leq \sup_{X_b} f$ and that $\inf_{X_a} f \leq B(z)$.
So we conclude that $y\in[A(z), B(z)]$ which is a contradiction.
If either $X_a$ or $X_b$ is empty, then the result changes slightly. I'll assume $X_a=\emptyset$ without loss of generality.
$$M=\sup_{X_b}f<y$$
Thus $y\notin [m,M]$, a contradiction.
The conclusion is that $[m,M] = \cup_x [A(x),B(x)]$.