A positive function with a certain property Does there exist a function $f: \mathbb R \to (0,\infty) $ such that $f(x)/f(y) \le |x-y| , \forall x \in \mathbb R \setminus \mathbb Q , \forall  y\in \mathbb Q$ ? 
 A: No, by Baire category theorem $f$ must vanish on a dense set.
Let $q_n$ be an enumeration of the rationals and set $M_n=f(q_n)>0$.
Define for $m\geq 1$:
$$ V_{n,m}= \{ x : M_n |x-q_n|<1/m\}$$
which is an open neighborhood of $q_n$. Then $U_m = \bigcup_n V_{n,m}$ is open and dense in ${\Bbb R}$. The function $f$ must satisfy $f(x)< 1/m$ on $U_m\setminus {\Bbb Q}$.
The intersection $$S=\left(\bigcap_{m\geq 1} U_m\right) \cap \left(\bigcap_{n\geq 1} {\Bbb R}\setminus\{q_n\} \right)$$ is dense by Baire and the function $f$ must vanish on $S$.
A: Let $(M,d)$ be a metric space , let $Y \subseteq M$ and $X:=M \setminus Y$ . 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$ is a $F_{\sigma}$ set 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< \dfrac 1{mf(y)} \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 , $\dfrac 1{mf(y)}=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$ .  
                                                                 QED

Now if $M$ is a  complete metric space without any isolated point and with a countable dense subset $Y$ then by Baire Category theorem , $X:=M \setminus Y$ 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 $Y=\mathbb Q$ , such a function cannot exist . 
