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:
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?