A function is a rule that takes an input and gives back exactly one output. Think of a little machine: you drop a number in, the machine does its one job, and a single number comes out the other side.

We write f(x) for "the output of the function f when the input is x". Move the input and switch the machine's rule — whatever you choose, one input still gives one output.

The one rule: one input, one output

That little word exactly is the whole idea. Every input is allowed just one output. A picture called a mapping diagram makes it clear: draw the inputs on the left, the outputs on the right, and an arrow from each input to its output.

It is fine for two inputs to share an output. What is not allowed is one input with two arrows leaving it — then the rule can't decide, so it isn't a function. Try the buttons: the middle one lets inputs b and c share an output (still a function), while the last makes input b sprout a second arrow — which is not.

The vertical-line test

On a graph there's a quick way to check. Sweep a vertical line across the picture: if the line ever crosses the curve more than once, that single input (x) would have two outputs — so it is not a function.

Drag the line. A straight line like y = 4 - 2x is caught exactly once, and so is the parabola y = x^2. Switch to x = y^2 and drag past the middle: two crossings appear, and the test fails.