The rational numbers are either whole numbers or fractions of whole numbers, like , , , , , and so on. The set of rational numbers is written
Irrational numbers like and are not included in the rational numbers are only those numbers which can be written as for integers and (where ).
Formally, is the underlying set of the field_of_fractions of (the ring of integers). That is, each is an expression , where is a nonzero integer and is an integer, together with certain rules for addition and multiplication. The rational numbers are the last intermediate stage on the way to constructing the real numbers, but they are also very interesting and important in their own right.
One intuition about the rational numbers is that once we've created the real numbers, then a real number is a rational number if and only if it may be written as , where are integers and is not .
Instead of taking the reals and selecting a certain collection which we label the "rationals", it is possible to construct the rationals given access only to the natural numbers; and from the rationals we may construct the reals. In some sense, this approach is cleaner than starting with the reals and producing the rationals, because the natural numbers are very intuitive objects but the real numbers are less so. We can be closer to satisfying some deep existential unease if we can build the reals out of the much-simpler naturals.
As an analogy, being able to produce a block of wood given access to a wooden table is much less satisfying than the other way round, and we run into blocks of wood "in the wild" so we are pretty convinced that there actually are such things as blocks of wood. On the other hand, we almost never see wooden tables in nature, so we can't be quite as sure that they're real until we've built one ourselves.
Similarly, everyone recognises broadly what a counting number is, and they're out there in the wild, but the rational numbers are somewhat less "natural" and their existence is less intuitive.