Find a function $f: \mathbb{R} \setminus \{0\} \rightarrow ??$, which satisfies
$$\ker(f) = ~ \sim$$
for the equivalence relation
$$x \sim y \iff \exists ~ p,q \in \mathbb{Q}: \frac{x}{y} = p+q \sqrt7 \text{ for }x,y \in \mathbb{R} \setminus \{0\},$$
where $\ker(f)$ is defined as $\ker(f):= \{(x,y) \in A \times A: f(x) = f(y) \}$
Recall that equivalence relations on a set $X$ correspond to partitions of $X$:
Given an equivalence relation $\sim$, the corresponding partition of $X$ is the set of equivalence classes of $X$ modulo $\sim$.
Given a partition $\mathcal{P}$ of $X$, the corresponding equivalence relation is the relation $x\sim y$ if and only if there exists $A\in\mathcal{P}$ such that $x,y\in P$.
In particular, given an equivalence relation $\sim$ on a set $X$, we can let $X/\sim$ be the seet of equivalence classes on $X$. Then we always have a map $$\pi\colon X\to X/\sim$$ given by $\pi(x) = [x]_{\sim}$, where $[x]_{\sim}$ is the equivalence class of $x$ under $\sim$. Note that by definition we will have $$\pi(x)=\pi(y)\iff [x]_{\sim}=[y]_{\sim}\iff x\sim y.$$ This is the "canonical projection" onto the set of equivalence classes.
In addition, one often defines the kernel of a function $f\colon A\to B$ to be the set $$\ker f= \{ (x,y)\in X\mid f(x)=f(y)\}.$$ This is the set that defines the equivalence relation "have the same image under $f$".
Given these facts, it should be straighforward to find a set and function that satisfy the desired properties.