# If $d$ is a metric and $f$ a function when is $d \circ f $ a metric?

Let $f: \mathbb R_{\geq 0} \to \mathbb R_{\geq 0}$ be a function and $d : X \times X \to \mathbb R_{\geq 0}$ a metric.

I've been thinking about what properties $f$ has to have for the following to hold: $f(d(x,y))$ is a metric if and only if $f$..., that is, I am looking for a *necessary and sufficient* condition on $f$ such that $f \circ d$ is a metric.

Clearly, we have to have $f(0) = 0$ since otherwise $d^\prime (x,y) := f(d(x,y))$ doesn't satisfy $d^\prime (x,y) = 0$ if and only if $x=y$. Also, we want that the only point that is mapped to zero by $f$ to be zero.

Since we always have $d^\prime (x,y) = d^\prime (y,x)$, all that remains to think about is the triangle inequality. At first I thought that $f$ had to be decreasing, i.e. $x<y$ implies that $f(x) \geq f(y)$ but is that good enough? I tried to come up with an example that breaks it but the examples I tried all seem to work (e.g. $e^{-x}, -x^2+30$)