Any number for which it is possible to express as the ratio or quotient of integers is a rational number. So yes, $5$ is rational, because it is possible to express this as $\frac 51, \frac {10}{2}...$.
$5$ is also an integer. Every integer is a rational number, but not all rational numbers, e.g. $\frac 12$, is an integer. We know $\frac 12$ is rational, because it is the quotient of two integers.
However, $\dfrac {\sqrt 7}{2}$ is not a ratio of integers. It is a ratio of a non-integer, namely $\sqrt 7$, over an integer. So $\dfrac{\sqrt 7}{2}$ is not rational.
I think the problem is that if you simply state those definitions exactly as they are you'll fall in the problem of not having defined the notion of "a quotient of integers". So the good and cool definition of rationals that solve all of these problems is to introduce one equivalence relation in a certain set. I don't know if you are used to equivalence relations (or even relations at all), so I'll talk about that first.
If you have two sets $A$ and $B$ you can create a relation $R$ between them which is a subset of the cartesian product $R\subset A\times B$. Think for a minute, elements of $A\times B$ are pairs $(a,b)$ with $a\in A$ and $b\in B$, so if $(a,b)\in R$ we are telling that $a$ is in some way related to $b$ and in this case we write $aRb$. Now, an equivalence relation can be introduced between a set and itself to mimic equality, it is usually denoted $\sim$ and satisfies those properties:
- $a\sim a$ (Reflexivity)
- $a \sim b \Longrightarrow b \sim a$ (Symmetry)
- $a \sim b \wedge b \sim c \Longrightarrow a\sim c$ (Transitivity)
In the third one the $\wedge$ symbol means AND. Look now that equality always obeys those three properties. So when we have a set and we want to construct a notion of the objects being equivalent without being equal we use an equivalence relation. Now, given a set $A$, an equivalence relation $\sim$ in $A$ and some element $a \in A$ the set of all other elements of $A$ equivalent to $a$ by $\sim$ is called equivalence class and denoted $\left[a\right]$. The set of all equivalence classes is called the quotient set and denoted $A/\sim$ and although the elements are sets of elements of $A$ we can usually think of $A/\sim$ as just the elements of $A$ with $\sim$ imposed on them.
Now returning to your problem! Given the set $\mathbb{Z}\times (\mathbb{Z}\setminus\{0\})$, in other words, ordered pairs of integers without any pair with $0$ in the second element we introduce the following equivalence relation $\sim$ on the set:
$$(a,b)\sim(a',b') \Longleftrightarrow ab'=a'b$$
Now stop for a while and look what we did! We are almost defining the quocient of integers. If we introduce the notation:
$$\frac{a}{b}=\left\{(a',b') \in \mathbb{Z}\times (\mathbb{Z}\setminus\{0\}) : (a',b')\sim (a,b)\right\}$$
We have exactly what the quotient is: the equivalence class of all those elements $(a,b)$ with the relation imposed. Proving this is really an equivalence relation is a good exercise. Now, look what I've said before: formally we define the quotient using equivalence classes but in practice we simply think of it as the element $(a,b) \in \mathbb{Z}\times(\mathbb{Z}\setminus\{0\})$ with the relation $\sim$ imposed.
Now, we define the set of rationals by:
$$\mathbb{Q}=(\mathbb{Z}\times(\mathbb{Z}\setminus\{0\}))/\sim$$
In other words, the set of rationals is the set of all quotients of integers, recalling that we defined the quotient as that equivalence class. With this your first definition is obviously equivalent (indeed we just made it formal using this thought) and the second is the exact same thing.
I hope this helps you somehow! Good luck!
Best Answer
$x$ and $y$ are commensurable if there exists a real number, $r$ and positive integers $m$ and $n$ such that $x = mr$ and $y=nr$. If such an $r$ exists, it is called a common measure. If $x$ and $y$ are commensurable, we can aviod mention of a common measure by writing $x : y :: m : n$, or $\dfrac xy = \dfrac mn$. The value of $r$ depends on the values of $x$ and $y$. Saying, for example, that $\sqrt 2$ is irrational is equivalent to saying that $\sqrt 2$ and $1$ are incommensurable.