(4) Let $f(x)=\left\{\begin{array}{ll}x-[x], & x \leqslant 0, \\ f(x-1), & x>0,\end{array}\right.$ where $[x]$ denotes the greatest integer not exceeding $x$. If the equation $f(x)=k x+k(k>0)$ has three distinct real roots, then the range of the real number $k$ is $\qquad$.
(4) $\left[\frac{1}{4}, \frac{1}{3}\right)$ Hint: Clearly -1 is always a root of the equation, and the other two roots are in the intervals $[0,1)$ and $[1,2)$, respectively. Therefore, the equation should have a root in the interval $[1,2)$ and no solution in the interval $[2,3)$. From the first case, we get $k<\frac{1}{3}$, and from the second case, we get $k \geqslant \frac{1}{4}$. Thus, $k \in\left[\frac{1}{4}, \frac{1}{3}\right)$.