Many books define a function or map as a "rule" that "assigns" to each element of a set $A$ one and only one element of a set $B$. This was unsatisfying for me given the vagueness of the terms within quotation marks.
Then, I came across a definition of function as a (binary) relation with certain properties. Hence, a function $f:A\rightarrow B$ is a subset of $A\times B$ with certain properties (to ensure that for each element of $A$ there corresponds only one of $B$). This made me happy.
Now, I just started studying category theory, and the definition of a functor confused me: in many different places I saw definitions along these lines: (this is from another post, the one that I refer in the end of the question)
A (covariant) functor $F:\cal C\to D$ of categories sends objects of $\cal C$ to those of $\cal D$, and similarly morphisms in $\cal C$ to morphisms of $\cal D$, such that the following three hold true:
- Identities are preserved: $F\,\mathrm{id}_A=\mathrm{id}_{FA}$.
- Sources and targets are preserved: If $A\xrightarrow{f}B$, then $FA\xrightarrow{Ff}FB$.
- Composition is preserved: If $A\xrightarrow{f}B\xrightarrow{g}C$, then $FA\xrightarrow{Ff}FB\xrightarrow{Fg}FC$.
So it seems that we are back to the mysterious concept of "sending objects to..." Now, I am not very familiar with concepts like class, maybe a functor can me seen as a relation between classes (instead of sets) or something along those lines i.e. can be seen as a function in a generalized sense for classes. I wonder...
(Note: I am aware of the question what is the difference between functor and function?, already asked in here. It is very different from this one, of course, despite the similarities in the title).