A function is a mathematical rule that takes an input and produces exactly one output. Think of it like a machine: you put something in, the machine processes it according to its rule, and gives you exactly one thing back. For example, the function y equals 2x plus 1 takes any number x, multiplies it by 2, and adds 1 to get the output y.