A function is defined as a rule that assigns each element from set X to one element in set Y, denoted as f: X → Y. It is essential that every element in X is paired with an element in Y, but not all elements in Y need to be paired. An example provided illustrates a function where, at any given time, a person can only be in one location, demonstrating the one-to-one relationship. Another example involves students and their weights, where each student corresponds to a unique weight, reinforcing the concept that no single input can map to multiple outputs. This discussion clarifies the fundamental characteristics and examples of functions in mathematical terms.