Why is $D(x)$ periodic?
Any rational number is a period. Let $q$ be a rational number, then $D(x+q)=D(x)$ $\forall x$, because if $x$ -- rational, then $x+q$ -- rational. And if $x$ -- irrational, then $x+q$ -- irrational.
Because$$(\forall x\in\mathbb R):D(x+1)=D(x).$$Is that a good enough reason?