How to construct a subset of $\mathbb{R}$ with maximum number of distinct points at any given distance from each point is 1? Let $\langle \mathbb{R} , d \rangle$ be the usual metric space over the real line. I want to find a set $A \subset \mathbb{R}$ such that for every $x \in A$ and any $r \in \mathbb{R}$, there is at the most one point $y \in A$ such that $d (x,y) = r$ and the cardinality of $\vert A \vert = \vert \mathbb{R} \vert$. Can you give an example of such a set?
 A: Consider the Cantor set with the set of endpoints of the removed thirds removed as well. That is, in the standard construction of the Cantor set, take $C_1=(0,1) \setminus \big[\frac{1}{3},\frac{2}{3}\big]$, instead of the usual $C_1=[0,1] \setminus \big(\frac{1}{3},\frac{2}{3}\big)$ (and so on for each $C_k$), and let 
$$C = \bigcap_{k=1}^\infty C_k$$
This differs from the usual Cantor set only in the endpoints of the removed sets (points like $\frac{1}{3}$,$\frac{2}{3}$,$\frac{1}{9}$,etc. are not in this set), but these are countable so our $C$ has the same cardinality as $\mathbb{R}$.
We now show that this set has the other required property of $A$ as well, i.e. for every $x \in C$ and any $r \in \mathbb{R}$, there is at the most one point $y \in C$ such that $d(x,y)=r$.
This is clear for $r \geq \frac{1}{3}$.
Now notice that for $r < \frac{1}{3}$, there is no way for $\big(0,\frac{1}{3}\big)$ and $\big(\frac{2}{3},1\big)$ to 'interact', i.e. if $x,y \in C$ are such that $d(x,y) < r$, both $x$ and $y$ must necessarily be in the same one of these intervals. So for $r < \frac{1}{3}$, we can just work with $C\cap\big(0,\frac{1}{3}\big)$ (for such an $r$, if $x \in C\cap\big(0,\frac{1}{3}\big)$, I need not worry about $C\cap\big(\frac{2}{3},1\big)$ containing a $y$ such that $d(x,y) = r$). But $C\cap\big(0,\frac{1}{3}\big)$ when blown up by a factor of $3$ is exactly the same as $C$. So by previous argument, we have taken care of all $r \geq \frac{1}{9}$ now. 
Proceeding in this manner, it is clear that for any $r > 0$, and any $x \in C$ there is at most one point $y \in C$ such that $d(x,y) = r$. And $d(x,y) \geq 0$, with equality if and only if $x =y$, this takes care of $r\leq0$.
