5. $[x]$ represents taking the integer part of the number $x$, for example $\left[\frac{15}{4}\right]=3$, etc. If $y=4\left(\frac{x+[u]}{4}-\left[\frac{x+[u]}{4}\right]\right)$, and when
$x=1,8,11,14$, $y=1$;
$x=2,5,12,15$, $y=2$;
$x=3,6,9,16$, $y=3$;
$x=4,7,10,13$, $y=0$.
Then the expression for $u$ is
(A) $\frac{x+2}{4}$;
(B) $\frac{x+1}{4}$;
(C) $\frac{x}{4}$;
(D) $\frac{x-1}{4}$.
5. (D)

If $u=\frac{x+2}{4}$, then when $x=2$, $u=1,[u]=1$, thus $y=4\left(\frac{1}{4}-\left[\frac{1}{4}\right]\right)=1$, which contradicts the given condition that $y=2$ when $x=2$, so (A) is incorrect.

Similarly, by setting $x=3$, we can determine that (B) is incorrect; by setting $x=4$, we can determine that (C) is incorrect. Therefore, (D) is correct.