Assume $f:[a,b]\to\mathbb{R}$ is bounded.
Let $P=\{x_0,...,x_N\}$ be a partition of $[a,b]$.
Why, for $1\leq n \leq N$ do we have that
$$\inf\{-f(x),\,\,\,x\in[x_{n-1,x_n}]\}=-\sup\{f(x),\,\,\,x\in[x_{n-1},x_n]\}$$
and
$$\sup\{-f(x),\,\,\,x\in[x_{n-1,x_n}]\}=-\inf\{f(x),\,\,\,x\in[x_{n-1},x_n]\}$$
Let's isolate all the distractions and pose a simple question that addresses the issue you are asking about.
Construct the set $$ A = \{ -3, 2, 7\}. $$ And define the set $$ A_{neg} = \{-x \; : x \in A\} = \{3, -2, -7\}. $$ Now compute each of: $$ \min A, \quad \max A, \quad \min A_{neg}, \quad \max A_{neg}. $$ Examine these four quantities. Are there pairs that are negatives of each other? Which ones? Write them down.
If this isn't yet giving satisfactory insight, try some slightly more complicated choices $A$: e.g., $A = \{ -7, -1, 0 \} \cup \mbox{(the set of all positive integers)}$. This one has no $\max$, so need to use $\sup$ instead.
In your question, the $A$ is more complicated: it is the range of $f$ on $[x_{n-1}, x_{n}]$, and you have to use $\inf, \sup$ instead of $\min, \max$. But, the principle is the same as in the first example I gave.