# Some functional equations in two variables

I have two questions.

i) Does there exist a function $\varphi:\mathbb{R}\to\mathbb{R}$ for which the functional equation $$|f(x)-f(y)|=\frac{1}{|\varphi(x)-\varphi(y)|}$$ has a solution $f:\mathbb{R}\to\mathbb{R}$ for all $x\neq y$?

ii) Let $\varphi(x)=x$.

Does the functional equation $$|f(x)-f(y)|=\frac{1}{|x-y|}$$ have a solution for all $x\neq y$?

-

Regarding (ii): No. You'd need $|f(1)-f(0)|=1$, $|f(3)-f(1)|=\frac12$ and $|f(3)-f(0)|=\frac13<1-\frac12$, contradiction.

Regarding the general case (i): For this to make sense, $\phi$ needs to be injective. Select $x,y,z$ with $\phi(x)<\phi(y)<\phi(z)$. Then $$\frac1{|\phi(x)-\phi(z)|}=|f(z)-f(x)|\ge |f(z)-f(y)|-|f(y)-f(x)|=\frac1{|\phi(z)-\phi(y)|}-\frac1{|\phi(y)-\phi(x)|}$$ implies $$|\phi(y)-\phi(x)|\cdot |\phi(z)-\phi(y)|\ge |\phi(x)-\phi(z)|\cdot(|\phi(y)-\phi(x)|-|\phi(z)-\phi(y)|)$$ or if we let $a:=\phi(y)-\phi(x)>0, b:=\phi(z)-\phi(y)>0$, $$ab\ge(a+b)(a-b)=a^2-b^2,$$ $$b^2+ab-a^2\ge 0.$$ This implies $b\ge\frac{\sqrt 5-1}2\cdot a$. From this it follows that the image of $\phi$ is discrete in $\mathbb R$ apart from possibly one limit point at the infimum, hence the image is at most countable, contradicting the injectivity of $\phi$.

-

Since $f$ is defined (if exists) up to a constant summand, we can suppose $f(0)=0$.
Set $y=0$: $$|f(x)|=\frac{1}{|x|}.$$ Substituting this in your equation, we get $|x-y|^2=|xy|$. Evidently, this is impossible.