TITLE: Proving that $\lceil f(x) \rceil$ $=$ $\lceil f(\lceil x \rceil )\rceil$ when $f(x) =$ integer $\implies x =$ integer
QUESTION [5 upvotes]: 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$?

REPLY [2 votes]: Consider the case where $x< \lceil x\rceil $ and assume that$\lceil f(x)\rceil <\lceil f(\lceil x\rceil)\rceil$. 
Firstly, $f(x)$ cannot be an integer or we'd have that $x$ must be an integer, a contradiction to $x< \lceil x\rceil. $ Hence 
$$
f(x)<\lceil f(x)\rceil.
$$
Also, since $\lceil f(x)\rceil$ is an integer, $\lceil f(x)\rceil <\lceil f(\lceil x\rceil)\rceil$ implies that
$$
\lceil f(x)\rceil<f(\lceil x\rceil).
$$ 

Combining the above 2 inequalities, we have  $f(x)<\lceil f(x)\rceil <f(\lceil x\rceil)$.

By the intermidiate value theorem, there is a $y\in(x,\lceil x\rceil)$ such that $f(y)=\lceil f(x)\rceil$.