**Update and answerUpdate and answer: The distance function $f_p(x)=d(p,x), p, x \in M$$f_p(x)=d(p,x)$, $p, x \in M$ cannot be smooth at any point $q \in C(p)$, where $C(p)$ is the cut locus of $p$. It is not differentiable at $q \in C(p)$ when there are at least 2 minimal geodesics connection $p$ and $q$. But it can be differentiable if $q \ne p$ is a first conjugate point with a unique minimal geodesic connecting $p$ and $q$; in this case, it cannot be differentiable up to the 2nd order though.