Usually for a ceiling function it can be written as function by cases. For example, if $f(x)=x* \lceil x \rceil $, then taking $f$ defined on the interval $]0,5[$, the $f$ can be written as $$ f(x)=\begin{cases}
x \quad \text{ if } \quad 0<x \leq 1 \\
2x \quad \text{ if } \quad 1<x \leq 2 \\
3x \quad \text{ if } \quad 2<x\leq 3 \\
4x \quad \text{ if } \quad 3<x\leq 4 \\
5x \quad \text{ if } \quad 4<x< 5 \\
\end{cases} $$
And as we can see, $f$ is even not continuous at $1,2,3,4$ , ingeneral such $f$ will not be conyinuous at any inetger even if it is defined on $\mathbb{R}$. Hence, it is not differentiable at any inetger, and thus no derivative exists at any $x=n$ with $n$ integer. On the other hand, if $x$ is not an integer, as we can see from the above example we can deal with $f$ depending its value in each open interval $]n,n+1[$. So for the above example we can see
$$ f'(x)=\begin{cases}
1 \quad \text{ if } \quad 0<x <1 \\
2 \quad \text{ if } \quad 1<x <2 \\
3 \quad \text{ if } \quad 2<x< 3 \\
4 \quad \text{ if } \quad 3<x< 4 \\
5 \quad \text{ if } \quad 4<x< 5 \\
\end{cases} $$
So $f'(x)=\lceil x \rceil $ if $x$ is not an integer, and $f'(x)$ is not defined if $x$ is an integer.
Anologously we may treat the case of the floor function as the case of the ceil function.
Starting from $n=0$ you have
$$d=0,0,1,1,2,2,3,3,4,4,5,5,6,6,\cdots$$
$$k=0,0,1,1,1,1,2,2,2,2,3,3,3,3,\cdots$$
In the last row, you see that the length of the runs is $4$, but the first run has only two elements.
Hence,
$$k=\left\lfloor\frac{n+2}4\right\rfloor$$
Alternatively,
$$d=\left\lfloor\frac n2\right\rfloor\equiv n=2d+d'$$
where $d'=0,1$.
$$k=\left\lceil\frac d2\right\rceil\equiv d=2k-k'$$
where $k'=0,1$.
Then
$$n=4k-2k'+d'=4k+k''$$
where $k''=-2,-1,0,1$.
By shifting,
$$n+2=4k+k'''$$ where $k'''=0,1,2,3$ and
$$k=\left\lfloor\frac{n+2}4\right\rfloor.$$
Best Answer
Hint
$f(x)$ may look something like this where it does have a derivative: