A function is a fundamental concept in mathematics and computer science. Think of it as a machine that takes an input and produces an output. The key property is consistency - for any given input, a function always produces the same output. For example, if we have a function that squares numbers, when we input 3, we always get 9 as the output.