Let $B=[a, b]\times[c,d]\dots\times[y,z]$ (A rectangle in $\mathbb{R}^{n}$) if there is $\mathcal{P}=\mathbb{P}_{B}$ such as $\underline{S} (f,\mathcal{P})=\overline{S} (f,\mathcal{P})$ then f is constant?
Could anyone give me a hint? Well, I think that the statement is false. My counterexample would be in $\mathbb{R} ^{n}$ Let $B=[0,1]\times[0,1]$ and f the constant $f(x,y)=0$ except in $(0.5,0.5)$, where the value of the function is 1. This function is integrable and then, the lower and upper sums are the same, but the function is not constant. Or I'm wrong?
Let $P = \{B_1, \dots, B_m\}$ be such a partition. If $\underline{S}(f,P) = \overline{S}(f,P)$, then we must also have $\underline{S}(f,B_k) = \overline{S}(f,B_k)$ for each $k$. This is because $\underline{S}(f,B_k) \leq \overline{S}(f,B_k)$ for each $k$ in general, and so equality in the former implies equality in the latter.
Recall that $\inf A = \sup A$ if and only if $A$ is a singleton. Therefore, $f$ must be constant over each $B_k$. The last observation is that $P$ is not a disjoint partition. Indeed, these $B_k$ will overlap with each other on boundaries. So $f$ must agree on each $B_k$, implying that it is constant generally.