6. If the function $f(x)=|x-[x+a]|$ has a maximum value $M(a)$, then the range of positive real number $a$ is $\qquad$ ( $[y]$ denotes the greatest integer not exceeding the real number $y$).

保留了原文的换行和格式。
6. $\left[\frac{1}{2},+\infty\right)$.

Let $x+a=N+\alpha$ (where $N$ is an integer, $0 \leqslant \alpha|-a|$, so, $f(x)$ has no maximum value;

When $a \geqslant \frac{1}{2}$, $-a \leqslant \alpha-a<1-a$, since $|-a| \geqslant|1-a|$, so, $f(x)$ has a maximum value, and when $\alpha=0$, i.e., $x+a$ is an integer, the maximum value of $f(x)$ is
$$
M(a)=a \text {. }
$$