Is there a positive function $f$ on real line such that $f(x)f(y)\le|x-y|, \forall x\in \mathbb Q , \forall y \in \mathbb R \setminus \mathbb Q$?

Does there exist a function $f:\mathbb R \to (0,\infty)$ such that $f(x)f(y)\le|x-y|, \forall x\in \mathbb Q , \forall y \in \mathbb R \setminus \mathbb Q$ ?

Solutions Collecting From Web of "Is there a positive function $f$ on real line such that $f(x)f(y)\le|x-y|, \forall x\in \mathbb Q , \forall y \in \mathbb R \setminus \mathbb Q$?"

There is no such function. Consider any function $g\colon \mathbb{Q} \to (0,+\infty)$. Let $Y := \mathbb{R}\setminus \mathbb{Q}$. For each $q\in \mathbb{Q}$, consider the function $h_q \colon Y \to (0,+\infty)$ given by

$$h_q(y) = \frac{1}{g(q)}\lvert y- q\rvert$$

and then

$$h(y) = \inf \{ h_q(y) : q \in \mathbb{Q}\}.$$

Since $Y$ is a Baire space (it’s a Polish space), if we had $h(y) > 0$ for all $y\in Y$, then there would be a nonempty open set $U \subset Y$ and an $\varepsilon > 0$ with $h(y) \geqslant \varepsilon$ for all $y\in U$: each $h_q$ is continuous, hence for every $\delta > 0$ the set

$$F(\delta) := \bigcap_{q\in \mathbb{Q}} h_q^{-1}([\delta,+\infty))$$

is closed. $h(y) > 0$ for all $y\in Y$ means

$$Y = \bigcup_{n = 1}^{\infty} F\bigl(\tfrac{1}{n}\bigr),$$

so $Y$ is written as a countable union of closed sets, and in a Baire space, one of these sets must have nonempty interior, say $\varnothing \neq U = \operatorname{int} F\bigl(\frac{1}{k}\bigr)$, then $h(y) \geqslant \frac{1}{k}$ on $U$.

But a nonempty open $U \subset Y$ contains a set $(a,b) \cap Y$ with $a < b$, and for $q \in (a,b) \cap \mathbb{Q}$ we have $h_q(y) < \varepsilon$ on the nonempty open subset

$$(q – g(q)\varepsilon, q + g(q)\varepsilon)\cap (a,b) \cap Y$$

of $(a,b) \cap Y$, and a fortiori $h(y) < \varepsilon$ there, in contradiction to $h(y) \geqslant \varepsilon$ on $(a,b) \cap Y$.

It follows that we have $h(y) = 0$ for some $y\in Y$ (in fact, every nonempty open subset of $Y$ contains zeros of $h$), and hence $g$ is not the restriction of an $f\colon \mathbb{R} \to (0,+\infty)$ with the property

$$f(x)f(y)\leqslant \lvert x-y\rvert$$

for all $x\in \mathbb{Q}, y \in Y$. For if it were, the construction above applied to $g = f\lvert_{\mathbb{Q}}$ would yield $0 < f(y) \leqslant h(y) = \inf \{h_q(y) : q \in \mathbb{Q}\}$ for all $y \in Y$.

Let $(M,d)$ be a metric space , let $X \subseteq M$ and $Y:=M \setminus X$ . If there exist a function $f:M \to (0,\infty)$ such that $f(x)f(y)\le d(x,y) , \forall x\in X , y\in Y$ , then $X,Y$ are $F_{\sigma}$ sets in $M$ .

Proof : For every $n \in \mathbb N$ , let $X_n:=\{x \in X | f(x) \ge 1/n\}$ .

We first claim that $\overline X_n \subseteq X , \forall n \in \mathbb N$ . If not , then $\exists m\in \mathbb N$ and some $y \in \overline X_m \setminus X$ ; as $y \notin X$ , so $y \in Y$ . Also , as $y \in \overline X_m$ , there is a sequence $\{x_k\}_{k \ge 1}$ in $X_m$ such that $x_k \to y$ ; whence $x_k \in X$ and $f(x_k) \ge 1/m , \forall k \ge 1$ . Thus $0< f(y)/m \le f(x_k)f(y) \le d(x_k,y) , \forall k \ge 1$ , where $x_k \to y$ as $k \to \infty$ , hence by Squeeze Principle , $f(y)/m=0$ i.e. $f(y)=0$ , contradicting $f(M) \subseteq (0, \infty)$ .

Thus $\overline X_n \subseteq X , \forall n \in \mathbb N$ .

Now as $f(M) \subseteq (0, \infty)$ , so for every $x \in M , \exists n\in \mathbb N$ such that $1/n \le f(x)$ ; hence

$M=\cup_{n \in \mathbb N} \{x \in M | f(x) \ge 1/n\}$ ; so $X=\cup_{n \in \mathbb N} X_n \subseteq \cup_{n \in \mathbb N} \overline X_n =X$ , thus

$X=\cup_{n \in \mathbb N} \overline X_n$ is a countable union of closed sets in $M$ i.e. a $F_{\sigma}$ set in $M$ .

Since the existence of the function ( the inequality ) is symmetric in the sets $X$ and $Y$ , the same proof works for $Y$ , showing that $Y$ is a $F_{\sigma}$ set in $M$ .

                                                                 QED


Now if $M$ is a complete metric space without any isolated point and with a countable dense subset $X$ , then by Baire Category theorem , $M \setminus X$ cannot be a $F_{\sigma}$ set ; hence for such $M$ and $X$ , a function satisfying the above properties cannot exist ; so in particular for $M=\mathbb R$ with usual Euclidean metric and $X=\mathbb Q$ , such a function cannot exist .