A function is a relation that pairs each element in a domain with one or more elements in the range. There are three types of functions: injective functions map each domain element to a unique range element; surjective functions map each range element to at least one domain element; bijective functions are both injective and surjective, providing a one-to-one correspondence between domain and range.