Formal definition for indexed family of sets Essentially I'd like to know the formal definition of the object $\{A_{i}|i\in I\}$ .This is my context: 
1.- From Wikipedia (Here) I understand that a family of elements in $S$ indexed by $I$ and denoted by $\{A_{i}|i\in I\}$ is a function $A:I\longrightarrow S$.
2.- From Hrbacek's book (Introduction to set theory): "We say that $A$ is indexed by $S$ if $A=\{S_{i}|i\in I\}=Ran(S)$, where $S$ is a function on $I$". Here I understand that I have the function $S:I \longrightarrow A$ and $\{S_{i}|i\in I\}$ is defined as the range of $S$. 
3.- From Hagen von Eitzen's answer (Here), I understand that a family $\{A_{i}|i\in I \}$ is a function $S:I\longrightarrow A$ and we write $A_{i}$ instead of $S(i)$.
So, I'm very confused because these definitions seems to be different to me, or maybe I'm missing something. I don't know. Could you guys help me clarify this?
Edit: I intuitively understand the concept. My problem basically is that there are some "inconsistencies" that I just don't get in the defintions: 


*

*In definition $1)$ if $A=\{A_{i}|i\in I\}$ is a function then $\bigcup A=\bigcup \{A_{i}|i\in I\} $. But formally the elements of a function are order pairs and then $\bigcup A$ is a set that doesn't equal the union of all the sets $A_{i}$. 

*In definition $2)$ It's been said that $A$ is indexed by $S$. So here I always thought that a $I$ is the set that index funtions, though here it does make sense to say $\bigcup \{A_{i}|i\in I\}$ because we are talking about the union of all the sets $A_{i}$.  

*When we are talking about sets, the object  $\{A_{i}:i\in I\}$ cannot contain repeated elements, but if we talk about a function it does matter the order and repeatition of elements. So, it's confusing.  
 A: Much like the definitions of "countable", "sequence" and "natural numbers" so does the definition of "family" can be changed from one context to another.
First note that the first and third interpretations are the same, they just use different letters. If we also require that the indexing is injective, that is to say that no set appears twice, then all the three interpretations coincide.
I think that the prevailing use today is generally the first/third interpretation, but you can also find the second one being used quite often. In those cases, this is actually like considering the first/third interpretation with the requirement that the indexing function is injective.
More often then not the writer expects the reader to be able and establish the proper context from the text. Not for every definition, of course, but for the very basic and implicit ones -- like the definition of a family. 

To your edit, when we say that $A$ is a family, regardless to how we treat, $\bigcup A$ is the union of the sets in the family, this is sort of an abuse of notation which really eases up on notation and formality once you are aware of it.
This might be a good reason to think of a family a set, rather than a function, too.
