Does the following definition of a family imply that there exist a surjection from $I$ onto the family ? Or should it be interpreted as a injective partial function from $I$ to the family ?
Should I understand it as: some elements of $I$ may not be used to index the elements of the family, but there are enough elements of $I$, such that every element of the family has an unique index ?
The if part "if for each $i \in I$ we have an associated object $x_i$" imply that an index set may have elements not mapped to an element of the family ?
But the bottom part of the definition make it seems that a subset of $\mathbb Z$ neccesarily are mapped to the family in an injective fashion ?
$\quad$ A family is a collection of objects, indexed by some set $I$, called an index set. If for each $i\in I$ we have an associated object $x_i$, the family of all such objects is denoted by $\{x_i\}_{i\in I}$. Unlike a set, a family may contain duplicates; that is, we may have $x_i=x_j$ for some pair of indices $i,j$ with $i\neq j$. If the index set $I$ has some natural order, then we may view the family as being ordered in the same way. As a special case, a family is indexed by a subset of $\mathbb Z$ of the form $\{m,\ldots,n\}$ or $\{m,m+1,\ldots\}$ is a sequence, which we may write as $\{x_i\}^n_{i=m}$ or $\{x_i\}^\infty_{i=m}$.
You should think of the indexed collection as a "function": for every $i \in I$ we have some well determined set $x_i$. This set $x_i$ can be empty, or we can have, as stated, that for different $i \neq j$ in $I$ we have these et set $x_i = x_j$. But this can also happen for functions (constant functions, or $x \rightarrow x^2$ that have the same image for $x=1$ and $x=-1$). So we always have an $x_i$ for every $i$.
Axiomatic/formal remark: The fact that $\{x_i: i \in I\}$ is a set (when $I$ is a set, and all $x_i$ are, and $x_i$ is "uniquely determined by $i$") is a consequence of the axiom of replacement.
And no, if we use $\mathbb{Z}$ or $\mathbb{N}$ or a finite subset as an index set, this does not mean that the assignment $n$ to $x_n$ is injective. We can easily have a sequence $(1,1,\ldots)$ indexed by $\mathbb{N}$ that is constant. Here $x_n = 1$ for all $n \in \mathbb{N}$, e.g.