TITLE: What is the set-theoretic definition of a function?
QUESTION [12 upvotes]: I'm reading through Asaf Karagila's answer to the question What is the Axiom of Choice and Axiom of Determinacy, and while reading the explanation of Bertrand Russell's analogy ("The Axiom of Choice is necessary to select a set from an infinite number of socks, but not an infinite number of shoes.") at the bottom, I realized I'm a little confused by what a function actually is in set-theoretic terms (and probably confused by some other things, too).
Basically, my confusion is this:

I thought that a function was specified by a finite string.
Thus, the reason that we need the Axiom of Choice to select a set from an infinite number of socks is that there's no way to define a choice function on an infinite number of socks using only a finite string.
However, if our universe is the set of natural numbers, aren't there an uncountable number of functions defined on our universe, but only a countable number of finite strings?

Where am I going wrong? What's the precise definition of a function, and what's the problem with my thinking in my last bullet point?

REPLY [2 votes]: Some authors say that the subset of $A\times B$ is the graph of a function and define a function to be an object with three parts as follows.

A set $D$ called the domain
A set $R$ called the range
A rule f tying each element $x\in D$ to a specific $f(x)\in R$

In this case we write $f:D\rightarrow R$.