In pag. 272 of Analysis I of Amann and Escher we can read
Let $f:I\to\Bbb R$ monotone, $\alpha:=\inf I$ and $\beta :=\sup I$. Then
$$\lim_{x\to\beta^-}f(x)=\begin{cases}\sup f(I),&\text{ if $f$ is increasing}\\\inf f(I),&\text{ if $f$ is decreasing}\end{cases}$$
$$\lim_{x\to\alpha^+}f(x)=\begin{cases}\inf f(I),&\text{ if $f$ is increasing}\\\sup f(I),&\text{ if $f$ is decreasing}\end{cases}$$
where $I$ means here interval (it is not stated open, closed or anything, just any kind of interval). But this theorem is in clear conflict with one of the exercises of the chapter, that I tried to solve here.
A short definition of the function of the linked exercise:
Let $\alpha:\Bbb N\to \Bbb Q$ a bijection, and a function
$$f:\Bbb R\to\Bbb R,\quad x\mapsto \sum_{k\in N_x}y_k$$
where $\sum_{k=0}^\infty y_k<\infty$ and $y_k>0$ for all $k$, and
$$N_x:=\{k\in\Bbb N:\alpha(k)\le x\}$$
Then consider $r\in\Bbb Q$.
Following the linked exercise and using the above theorem we have that for a restriction on $f$ to some interval of the kind $(-\infty,r]$ have us
$$\lim_{x\to r^-}f(x)=\sup f((-\infty,r])=f(r)$$
because $f$ is strictly increasing. In the same way restricting $f$ to some set of the kind $[r,\infty)$ applying the cited theorem we have that
$$\lim_{x\to r^+}f(x)=\inf f([r,\infty))=f(r)$$
Then for $r\in\Bbb Q$ the function is continuous, following the above theorem. But the exercise ask to prove the discontinuity of $f$ at all rational points. So, where is the mistake? It is incorrect the theorem?
The theorem you cite doesn't seem true. One should ask continuity for $f(x).$
However, as a counterexample, take
$$ f(x) = x + n \qquad \text{for} \quad n - 1 < x \leq n. $$
Of course in the interval $[1,2]$ you have
$$ \inf (f(x)) = f(1) = 2, \qquad \text{but} \quad \lim_{x\rightarrow1^+}f(x) = 3. $$
So, you are right.