Abstract
In this chapter we introduce the basic concepts needed in order to work with functions. We begin with the intuitive idea of a function and its mathematical definition as a special kind of relation. We then see how general concepts for relations play out in this particular case (domain, range, restriction, image, closure, composition, inverse) and distinguish some important kinds of function (injective, surjective, bijective). These concepts permit us to link functions with counting, via the principles of equinumerosity, comparison and the surprisingly versatile pigeonhole rule. Finally, we identify some very simple kinds of function that appear over and again (identity, constant, projection, characteristic and choice functions), and explain the use of functions to represent sequences and families.