When constructing $\mathbb{Q}$ as equivalence classes containing pairs of integers, a natural inclusion of $\mathbb{Z}$ in $\mathbb{Q}$ arises: $$f: \mathbb{Z} \to \mathbb{Q}, \; n \to \frac{n}{1}. $$ This mapping is not surjective, but it is injective, and the function is well-defined. My question is: is injectivity required for us to conclude that $\mathbb{Z} \subset \mathbb{Q}$?
It seems to me that this isn't the case. I could assign two distinct integers to the same rational, and $\mathbb{Z}$ would still be embedded in $\mathbb{Q}$. I could assign every $n \in \mathbb{Z}$ to the rational $\frac{0}{1}$ and still prove the result.
Is this correct?
As a side question, when we talk about an inclusion map, must I map $\mathbb{Z}$ to $\mathbb{Q}$ or could I instead map $\mathbb{Q}$ to $\mathbb{Z}$ by the rule $\frac{n}{1} \to n$? In this case, perhaps it wouldn't work because the function would not be well-defined for all $\mathbb{Q}$. I'm interested in particular on how we defined an inclusion map.
You can do whatever you like. However an embedding is by definition an injective function (with some other properties, depending on the context). Assigning $n\mapsto \frac{0}{1}$ is not an embedding. It is just a constant function. Since you can't distinguish image of say $2$ and $3$ then how can you say that these represent integers? For something to be a set of integers it has to be infinite at least.
Also $\frac{n}{1}\mapsto n$ is not even a function on $\mathbb{Q}$. Not every rational is of the form $\frac{n}{1}$, e.g. $\frac{1}{2}$. So this is not well defined.
Therefore yes: being injective is crucial.