This is my first post, and so I hope this response is above the minimum level of usefulness expected of a response on MO.
Perhaps a start would be to consider metrics of the form $f(x,y)=g(g^{-1}(x) - g^{-1}(y))$$f(x,y)=g(h(g^{-1}(x),g^{-1}(y))$, where $g$ is some invertible function.
We can place restrictions on $g$ and $h$ by considering the conditions for $f(x,y)$ to be a valid metric.
Firstly, definiteness requires $f(x,x)=0$, so we have $g(g^{-1}(x) - g^{-1}(x))=0$$h(g^{-1}(x),g^{-1}(x))=g^{-1}(0)$, and so the definiteness requirement reduces to $g(x)=0$$h(a,b)=g^{-1}(0)=g_0$ iff $x=0$$a=b$.
Secondly, we have the symmetry requirement. Since we require $f(x,y) = f(y,x)$ it follows that $g(g^{-1}(x) - g^{-1}(y)) = g(g^{-1}(y) - g^{-1}(x))$$g(h(g^{-1}(x),g^{-1}(y))) = g(h(g^{-1}(y),g^{-1}(x)))$ and so $g(x) = g(-x)$$h(a,b) = h(b,a)$. If $h$ is continuous, then $g_0$ is either the maximum or minimum value taken on by $h$.
Now, lets turn to the associativity requirement you have specified: $f(x,f(y,z))=f(f(x,y),z)$. We have $f(f(x,y),z)=g(g^{-1}(g(g^{-1}(x) - g^{-1}(y))) - g^{-1}(z))$$f(f(x,y),z)=g(h(g^{-1}(g(h(g^{-1}(x),g^{-1}(y)))),g^{-1}(z)))$. SinceLet $f(f(x,y),z) = f(f(y,x),z)$, from the symmetry condition$g^{-1}(x)=a$, $f(f(x,y),z)$ can be rewritten as$g^{-1}(y)=b$ and $f(f(x,y),z)=g(-g^{-1}(x)+g^{-1}(y)-g^{-1}(z))$$g^{-1}(z)=c$. Applying the identity operationThen $g^{-1}\circ g$ we obtain$g^{-1}(f(f(x,y),z))=h(h(a,b),c)$ and $f(f(x,y),z)=g(-g^{-1}(x)+g^{-1}(g(g^{-1}(y)-g^{-1} (z))))=f(f(y,z),x)$$g^{-1}(f(x,f(y,z)))=h(a,h(b,c))$, and so by the symmetry again we obtainassociativity requirement on $f(f(x,y),z)=f(x,f(y,z))$$f$ becomes an associativity requirement on $h$.
SoApplying the question reduces to whether there exists a function $g$ which is both eventhird condition, invertible and hasthe triangle in equality, we obtain the restriction that $g(0)=0$ which satisfies$g \circ f$ obeys the triangle inequalityin equality. I suspectSince this can be expressed asis not specifically a condition on $f$, it seems that a reasonable approach would be to look for any function $h(a,b)$ with the first derivativefollowing properties: 1) There exist some $g_0$ such that $h(a,b)=g_0$ iff $a=b$, 2) $h(a,b)=h(b,a)$ and 3) h(h(a,b),c)=h(a,h(b,c)). Since we can set $g_0=0$ without loss of generality $g$(by choosing $g'(x) = g(x)-g_0$), finding a $h$ satisfying only 3 criteria: 1) Definiteness, 2) Symmetry and 3) Associativity, would seem to go a long way towards producing a metric of the desired form.