# Example of bijection from $\mathbb{Q} \to \mathbb{Q} \times \mathbb{Q}$

What would be an example of bijection between $\mathbb{Q}$ and $\mathbb{Q}\times \mathbb{Q}$.

I can think of one: $x \mapsto (x,x+1)$ Does this work? I am not sure.<

-
Is it surjective? –  Lord_Farin Apr 17 '13 at 10:30
@Lord_Farin: Oh sorry. I think it isn't. Because the point $(3,5)$ doesn't have a preimage at all. Thanks. Foolish on my behalf –  limit Apr 17 '13 at 10:32
Using the fact that $\mathbb Q$ is countable and a finite Cartesian product of countable sets is itself countable, there exist 2 bijections:
$$f: \mathbb Q \rightarrow \mathbb N$$ $$g: \mathbb N \rightarrow \mathbb Q \times \mathbb Q$$
And the composition $g \circ f$ will yield a bijection from $\mathbb Q$ to $\mathbb Q \times \mathbb Q$