Let $I=\{1\}\cup\{2\}$, for $x\in\mathbb{R}$,$f(x)=\operatorname{dist}(x,I)=\inf\{|x-y|:y\in I\}$ Then
1.$f$ is discontinuous some where on $\mathbb{R}$
2.$f$ is continuous on $\mathbb{R}$ but not differentiable only at $1$
3.$f$ is continuous on $\mathbb{R}$ but not differentiable only at $1,2$
4.$f$ is continuous on $\mathbb{R}$ but not differentiable only at $1,2,3/2$
What I think is $f(x)=0$ when $x=1,2$ and $f(x)>0$ when $x\in \mathbb{R}\setminus\{1,2\}$ so it is continuous on $\mathbb{R}$ and it is not differentiable at $1,2$. Am I right?