Is there any metric $d$ on $\mathbb R$ and $a \in \mathbb R$ such that the function $f:\mathbb R \to \mathbb R$, $f(x)=d(x,a)$ is differentiable? Let $d$ be any metric on $\mathbb R$ , then I know that the two variable scalar field $f: \mathbb R^2 \to \mathbb R$ , $g(x,y)=d(x,y)$ is never differentiable . Now what I want to ask is this : Let $a \in \mathbb R$ , then is it true function $f:\mathbb R \to \mathbb R$ defined as $f(x)=d(x,a) , \forall x\in \mathbb R $ is not differentiable ?
I only know that if $f$ is differentiable  then $f'(a)=0$ and in particular for the standard euclidean metric , $f$ is not differentiable .
Please help . Thanks in advance 
 A: Let $g(u)=u\exp(-1/u^2)$ for $u\not =0$, and $g(0)=0$. We see that $g^{\prime}(0)=0$, and $g^{\prime}(u)>0$ if $u\not =0$. Hence $g$ is strictly increasing on $\mathbb{R}$.Put  $d(x,y)=|g(x-a)-g(y-a)|$; it it easy to se that this is a distance on $\mathbb{R}$. Now $d(x,a)=|g(x-a)|$. As $g$ if differentiable at $u=0$, with $g^{\prime}(0)=0$, we get that $f(x)=d(x,a)$ is differentiable at $a$, (with f^{\prime}(a)=0$).
Let $b>a$. For $x$ close to $b$, we have $x>a$, hence we get $d(x,a)=g(x-a)$ and $d(b,a)=g(b-a)$. Hence $f(x)=d(x,a)$ is differentiable at $b$. Same proof for $b<a$. 
A: Define $d(x,y) = |x^3 - y^3|.$ Then $d$ is a metric on $\mathbb R$ (which is topologically equivalent to the usual metric on $\mathbb R$). Taking $a=0,$ we have $d(x,0)= |x|^3$ for all $x,$ which is a differentiable function on $\mathbb R.$
A: Let $h:R\to R$ be  differentiable and strictly monotonic, with $h(0)=h'(0)=0$ and  with $h' (x)$ continuous at $ x=0. $ (E.g. $h(x)=x^3.$)  For any fixed $a\in R$ let $d(x,y)=|h(x-a)-h(y-a)|.$ It is trivial to verify that $d$ is a metric. Let $f(x)=d(x,a)=|h(x-a)|.$ 
Any $x<a$ has a nbhd $U$ on which $y\in U\implies f(y)=-h(y-a).$
Any $x>a$ has a nbhd $V$ on which $y\in V\implies f(y)=h(y-a).$
So $f'(x)$ exists for  $x\ne a.$
For any $x\ne a ,$ by the MVT, there exists $x'$  between $x$ and $a$ such that $$f(x)=|h(x-a)|=|h(0)+h'(x'-a)(x-a)|=|h'(x'-a)(x-a)| .$$ So $$\frac {f(x)-f(a)}{x-a}=\frac {|h(x-a)|-|h(0)|}{x-a}=\frac {|h(x-a)|}{x-a}=\frac {|h'(x'-a)(x-a)|}{(x-a}=\pm h'(x'-a).$$ Now $x'-a\to 0$ as $x\to a,$ and $h'$ is continuous at $0,$ with $h'(0)=0,$ so  we have $f'(a)=0.$ 
