The set definitions of pairs, tuples, relations, functions, and integers only serves to show that set theory can be used as a formal basis for pretty much all of mathematics. The point of set theory was to reduce as many ideas as possible to as few as possible. It makes everything it can into a set.
If you have done any computer programming before, it's essentially the same concept. Computer languages only understand a limited set of objects: integers, floating point numbers, unicode characters, functions, and lists of other objects (or some similar-looking list). But then, how do you program a 3-D game? There are no "vectors" in the computer's eyes! The answer is you have to "build" vectors yourself out of what's given. A vector might be a list of floating point numbers, coupled with functions that can act on them (addition, scaling, dot products). What about a matrix? Well, now that we've defined vectors, a matrix is simply a list of vectors and functions for how to multiply them, transpose them, take their determinants, etc.
We're doing the same thing here with sets. You start off with only sets. Nothing but sets. Well, how do we make ordered pairs? We define them in terms of sets: (a, b) = {{a}, {a, b}} or whatnot. What about relations? We define a~b to be a set of pairs. What about functions? We define a function as a relationship with a condition that no two pairs (a, b) and (a', b') in the relation can have a = a'.
In a sense, we are merely "programming" the rest of mathematics with set theory. After we have defined a function in terms of sets, we can treat it as if functions are their own "real" entites. Once we have proven basic theorems about functions by their definition (composition is associative, and basic principles behind "onto" and "one-to-one" functions), we can more or less completely forget about the definition, knowing that as long as we defined it properly and made no mistakes in our core theorems, evereything else we prove with them will be correct, regardless of the details of the definition.
The take home message is, if sets are the only "primitive" object you have at your disposal, you can define many other mathematical objects in terms of them. Functions are not *really* sets. But if you went to a planet where functions were not yet discovered, but where the natives understood sets, you could give a precise description of what Earth mathematicians mean by "function."