$\begingroup$

I just learned about cardinality in my discrete class a few days ago, and this is in the homework. This is all fairly confusing to me, and I'm not entirely sure where to even start. Here's the full question:

Let $\mathbb{Q}$ denote the set of rational numbers and $\mathbb{Z}$ denote the set of integers. Prove that $|\mathbb{Q}| = |\mathbb{Z}|$.

I thought about saying that every element in $\mathbb{Q}$ can be written as some element in $\mathbb{Z} \times \mathbb{Z}$, but I still don't know how to prove that that is a bijection, or even how to prove that $|\mathbb{Z} \times \mathbb{Z}| = |\mathbb{Z}|$.

Any help would be greatly appreciated.

Answers