A utility function is a mathematical construct in economics and decision theory that ranks an individual's preferences over a set of choices. It assigns a numerical value, or utility, to different outcomes, reflecting the level of satisfaction or desirability. This allows for a quantitative representation of choices and is fundamental to understanding rational behavior.