Let $f(x)$ be a real continuous function defined in a closed interval $[a, b]$, and $D\subset[a,b]$ an infinite countable subset. Suppose that $f(x)$ is differentiable at all points in $[a,b]-D$, and for any $x_0\in[a,b]-D$, $|f'(x)|\leq M$, where $M$ is a fixed positive number. Show that $f(x)$ is Lipschitiz continuity condition on $[a,b]$; i.e., there exists some $L>0$ such that $|f(x_1)-f(x_2)|\leq L|x_1-x_2|$ for any $x_1, x_2\in[a,b]$.
My idea is that, for all $x_0\in[a,b]-D$, if we can prove that there is a neighborhood around $x_0$ such that $|f(x_1)-f(x_2)|\leq L|x_1-x_2|$ within the neighborhood, then these neighborhoods form open covers of $[a,b]$ because $[a,b]-D$ is obviously dense in $[a,b]$. Then since $[a,b]$ is compact, we may select finite subcovers. However, $f(x)$ is not necessarily differentiable at all points in $(a,b)$, we cannot apply the Mean Value Theorem to the condition $|f'(x)|\leq M$. Hence, is there any idea to deal with the difficulty?