At first I was looking for a way to have a function definition which is one-to-one from $\mathbb{R}^n$ to $\mathbb{R}$. Then I have seen this question and it seems according to the rank-nullity theorem, this is not possible.
How about the vector spaces over $\mathbb{Q}$ ? Is it possible to define a one-to-one function from $\mathbb{Q}^n$ to $\mathbb{Q}$ such that
$$ f : \mathbb{Q}^n \rightarrow \mathbb{Q} $$
If this is true, do you have an example of a function that satisfy it?