|x|
The key to this is the fact that $\displaystyle D$ is bounded.
That means that $\displaystyle \exists M>0$ such that $\displaystyle D\subset [-M,M]$.
In your text material you should have a proof that a continuous function is bounded on a closed interval of real numbers. This new proof follows that proof very closely.