Characteristics of Floor and Ceiling Function

Theorem
Let $f: \R \to \Z$ be an integer-valued function which satisfies both of the following:
 * $(1): \quad f \paren {x + 1} = f \paren x + 1$
 * $(2): \quad \forall n \in \Z_{> 0}: f \paren x = f \paren {\dfrac {f \paren {n x} } n}$

Then either:
 * $\forall x \in \Q: f \paren x = \floor x$

or:
 * $\forall x \in \Q: f \paren x = \ceiling x$

Proof
From $(1)$, by induction we have:
 * $\forall n \in \N: f \paren {x + n} = f \paren x + n$

and
 * $\forall n \in\N: f \paren {x - n} = f \paren x - n$

and therefore, in particular:


 * $(3): \quad \forall n \in \Z: f \paren n = f \paren 0 + n$

From $(2)$, we get

Hence
 * $f \paren 0 = 0$

Thus from $(3)$ it follows that:
 * $\forall n \in \Z: f \paren n = n$

Suppose that $f \paren {\dfrac 1 2} = k \le 0$.

Then:

We show that in this case, by induction:
 * $f \paren {\dfrac 1 n} = 0$ for all $n \in \N$

Induction hypothesis:
 * $f \paren {\dfrac 1 {n - 1} } = 0$

Then from $(1)$:
 * $f \paren {\dfrac n {n - 1} } = f \paren {\dfrac 1 {n - 1} + 1} = 0 + 1 = 1$

so:

Finally, we show by induction on $m$ that even:
 * $f \paren {\dfrac m n} = 0$

for $m \in \set {1, \ldots, n - 1}$.

Above we have shown this for $m = 1$.

Let $1 \le m < n$.

If $m \divides n$, then
 * $f \paren {\dfrac m n} = f \paren {\dfrac 1 {n / m} } = 0$

Otherwise, write:
 * $ n = \paren {k - 1} m + r$

Then:
 * $k > 1$

and:
 * $1 \le r \le m - 1$

We therefore have:
 * $k m = n + m - r$

so by the induction hypothesis:
 * $f \paren {\dfrac {k m} n} = f \paren {1 + \dfrac {m - r} n} = 1 + f \paren {\dfrac {m - r} n} = 1$

Then:

By $(1)$, this shows that
 * $f \paren {\dfrac 1 2} \le 0 \implies f \paren x = \floor x$

for all rational $x$.

Suppose that $f \paren {\dfrac 1 2} = k > 0$.

Then the integer-valued function $g: \R \to \Z$ satisfies:
 * $g \paren x = -f \paren {-x}$

satisfies $(1)$ and $(2)$, and also:

Thus:
 * $f \paren {\dfrac 1 2} > 0 \implies f \paren x = \ceiling x$

for all rational $x$.