TITLE: In what manner are functions sets?
QUESTION [9 upvotes]: From Introduction to Topology, Bert Mendelson, ed. 3, page 15:

A function may be viewed as a special case of what is called a relation.

Yet, a relation is a set

A relation $R$ on a set $E$ is a subset of $E\times E$.

while a function is a correspondence or rule.  Is then a function also a set?

REPLY [5 votes]: Others have said, clearly and nicely, how to represent or model functions by sets. 
And that's the right way to put it. Here are three reasons not to say that functions are sets.

It might be conventional to treat the binary function $f(x) = y$ as corresponding to a certain set of ordered pairs $(x, y)$, and then  treat the ordered pairs by the Weiner-Kuratowski construction. But at both steps we are making arbitrary choices from a range of possibilities. You could use the set of ordered pairs (y, x) [I've seen that done], and you could choose a different set-theoretic representation of ordered pairs [I've seen that done]. Since the conventional association of the function with a set involves arbitrary choices, there isn't a unique right way of doing it: none, then, can be reasonably said to reveal what a function really is. We are in the business of representing (relative to some chosen scheme of representation).
Some functions are "too big" to have corresponding sets. Take the function that maps a set to its singleton. The ordered pairs $(x, \{x\})$ are too many to form a set. If a function is too big to have a corresponding set, it can't be that set.
Most importantly, it would be a type confusion to identify a function with an object like a set. A function maps some object(s) to an object. In terms of Frege's nice metaphor, functions are "unsaturated", come with one or more slots waiting to be filled (where filling the single slot in, say, the unary numerical function the square of ... gives us a number). In modern terminology, functions have an intrinsic arity.  By contrast, objects aren't unsaturated, don't have slots waiting to be filled, don't have arities, don't do mapping. And what applies to objects in general applies to those objects which are sets in particular. So functions aren't sets.