Are functions arbitrary? If so, is that okay? I'm learning about functions between sets. I get the concept. But I'm having a hard time drinking the kool-aid, so to speak. There's some part of my mind that thinks (loudly), 

Wait. How does this author justify claiming that he can connect two things together however he likes. There has to be some justification to connect them.

But I get that -really- all a function between two sets is doing is saying is 

This is what things would look like if you connected the elements of these two sets

But still, intuitively, it strikes me as potentially problematic. For instance, we used to be able to assign any element we wanted to a set - that turned out to be a problem. I don't necessarily wonder whether functions would lead to the same problem, but perhaps to some other problem arising from arbitrarily relating things?
Do functions have the potential to lead to that kind of a problem, or any other problem? Is there a better way to think of them than I've described?
 A: Yes. Functions are arbitrary.
In modern mathematics, and in particular in set theory, a function is just a set of ordered pairs which have some properties.
One can ask, what is a natural number? The answer, intuitively, would be "you know... like $1,2,3,4$ and so on.", but that's not a mathematical answer. The mathematical answer, circular as it may be, is probably along the lines of "an element of the standard model of the Peano axioms".
And so a function is not something which necessarily coheres with our intuition, like $f(x)=x+5$ or so. Functions are just sets which satisfy a certain property which makes them functions.
A: See the answer of Asaf. To proceed on the 'certain property' mentioned
by him:
Formally in set-theory a function from set $X$ to set $Y$ is a
subset $f$ of the cartesian product $X\times Y$ having the following
property:
For every $x\in X$ there is a unique $y\in Y$ such that $\left(x,y\right)\in f$. 
The unique $y$ mentioned here is denoted by $f\left(x\right)$.
In other parts of mathematics a function is defined as a triple $f=\left(X,G,Y\right)$
where $G$ is a subset of $X\times Y$ having the property just mentioned.
Here by definition $X$ is the domain, $Y$ is the codomain and $G$ is the graph of $f$.
A: To the extent that you have a particular function in mind, there is no problem.  Given two sets $X$ and $Y$, we can define the Cartesian product $X \times Y$, which is the set of ordered pairs $(x,y)$ with $x\in X$ and $y \in Y$.  A function from $X$ to $Y$ can be seen as a subset of this Cartesian product, with the additional requirement that it does not contain two elements $(x, y_1)$ and $(x, y_2)$ with $y_1\neq y_2$.  So if you have a way to specify $f(x)$ for each $x\in X$, then $$\left\{ (x, y)\in X\times Y : y=f(x) \right\}$$ is a set.  However, if you don't have a particular $f(x)$ in mind, then the existence of any function from an infinite set to another (for instance, from an infinite set of nonempty sets $X$ to the set $\bigcup X$) cannot be justified without a new axiom: the axiom of choice.   
