On P. 71 in 'Concrete Mathematics' the following Theorem is given:
Let $f$ be any continuous, monotonically increasing function on an interval of the real numbers, with the property that \begin{equation}f(x) = \mathit{integer}\ \ \ \implies\ \ \ x = \mathit{integer} . \end{equation} Then we have \begin{equation} \lfloor f(x) \rfloor = \lfloor f(\lfloor x \rfloor )\rfloor\ \ \ \ and\ \ \ \lceil f(x) \rceil = \lceil f(\lceil x \rceil )\rceil, \end{equation} whenever $f(x)$, $f(\lfloor x \rfloor)$, and $f(\lceil x \rceil)$ are defined.
The proof for the second equation goes as follows:
If $x = \lceil x\rceil$, there's nothing to prove. Otherwise $x < \lceil x\rceil$, and $f(x) < f(\lceil x \rceil)$ since $f$ is increasing. Hence $\lceil f(x)\rceil \leq \lceil f(\lceil x\rceil)\rceil$, since $\lceil \cdot\rceil$ is nondecreasing. If $\lceil f(x) \rceil < \lceil f(\lceil x\rceil)\rceil$, there must be a number $y$ such that $x \leq y < \lceil x\rceil$ and $f(y) = \lceil f(x)\rceil$, since $f$ is continuous. This $y$ is an integer, because of $f$'s special property. But there cannot be an integer strictly between $\lfloor x\rfloor$ and $\lceil x\rceil$ . This contradiction implies that we must have $\lceil f(x) \rceil = \lceil f(\lceil x \rceil )\rceil$.
The part of the proof that I don't understand:
If $\lceil f(x) \rceil < \lceil f(\lceil x\rceil)\rceil$, there must be a number $y$ such that $x \leq y < \lceil x\rceil$ and $f(y) = \lceil f(x)\rceil$, since $f$ is continuous.
Why is $f(y)=\lceil f(x) \rceil$?
Note that the condition $\lceil f(x) \rceil < \lceil f(\lceil x\rceil)\rceil$ implies $\lceil f(x) \rceil < f(\lceil x\rceil)^{(*)}$, as otherwise $\lceil f(x) \rceil \geq f(\lceil x\rceil)$, which, by virtue of $\lceil f(x) \rceil$ being an integer, is equivalent to $\lceil f(x) \rceil \geq \lceil f(\lceil x\rceil)\rceil$, a contradiction. Since $f$ is continuous, it satisfies the intermediate value theorem. Therefore, since $f(x) \leq \lceil f(x) \rceil < f(\lceil x\rceil)$, there exists $y$ such that $x \leq y < \lceil x\rceil$ and $f(y) = \lceil f(x) \rceil$.
$^{(*)}$ There is no reason for the inequality $\lceil f(x) \rceil < f(\lceil x \rceil)$ to hold otherwise, as illustrated by $f(x) = x$, which satisfies the conditions of the theorem.