Solution (source code)

= Solution

For the first additional construction, modify the rational/irrational example to
$$
\boxed{g(x)=\begin{cases}x^2,&x\in\mathbb Q,\\-x^2,&x\notin\mathbb Q.\end{cases}}
$$
At zero, $|g(h)/h|=|h|\to0$, so $g'(0)=0$. At any nonzero point, <density of the rational numbers> and <density of the irrational numbers> give incompatible limiting values $x^2$ and $-x^2$. Thus $g$ is discontinuous, and hence not <differentiable>, there. \b[Its <differentiability> set is exactly $\{0\}$.]

For the second construction, use a <summable absolute-value cusp series>:
$$
\boxed{G(x)=\sum_{n=2}^\infty2^{-n}\left|x-\frac1n\right|.}
$$
On $[-R,R]$, each summand is bounded by $2^{-n}(R+1/2)$. The <Weierstrass M-test> therefore gives <uniform convergence> on every bounded interval, and the <uniform limit theorem> makes $G$ <continuous> everywhere.

To justify <differentiability>, each summand's <difference quotient> has absolute value at most $2^{-n}$, by the <reverse triangle inequality>. The sum of these bounds is finite, uniformly in the increment. Thus the tail of the <difference quotient> is uniformly small, and limits may be passed through the sum by first retaining finitely many terms and then making the tail small. If $x\ne1/n$ for every $n\ge2$, each individual summand is <differentiable>, giving
$$
G'(x)=\sum_{n=2}^\infty2^{-n}\operatorname{sgn}(x-1/n).
$$
In particular \b[$G'(0)=-\sum_{n=2}^\infty2^{-n}=-1/2$]. The accumulation of cusp locations at zero does not destroy the <derivative>, because their weights are summable.

At $x=1/m$, the same tail argument applies to both one-sided <derivatives>. Every term except the $m$th has the same derivative from both sides; the $m$th has derivatives $-2^{-m}$ and $2^{-m}$. Consequently
$$
G'_+(1/m)-G'_-(1/m)=2^{1-m}>0.
$$
Therefore \b[$G$ fails to be <differentiable> exactly at $1/2,1/3,1/4,\ldots$, and is <differentiable> everywhere else].