Mathematics & Logic · Algebra & functions

What a function is, and why it can't always run backward

A function is a rule that gives each input exactly one output. See why two inputs can share an output, where a formula stops applying, and why working back from an output can fail.

4 short lessons · about 17 minutes · 6 sources · updated November 2026

What you will learn

  • Recognize that a function gives each allowed input exactly one output
  • Explain why different inputs can share an output
  • Evaluate a function by substituting an input into its rule
  • Tell the inputs a formula can compute from the inputs a model actually covers

Lesson 1 of 4 · 4 min

What makes a rule a function?

Before you readA gym list gives each member one locker number. Two different members are then both given locker 12. What does that do to the list?

Correct.Not quite. The answer is Nothing, since each member still gets one number.

Nothing breaks. A function needs one output for each input, and it allows different inputs to share an output. This lesson shows what does and does not make a rule a function.

Picture a gym list that gives each member a locker number. You look up your name and get one definite number. If the list gave you two, you wouldn't know where your bag was.

A lookup like that is called a function. Each allowed input has exactly one output. Here the input is a member and the output is a locker number.

A function doesn't need a formula. The calendar is one. Put in March and you get 31 days, and no algebra produces that 31. The input can be a name, a month or a number.

Say the list puts Ana in locker 12 and Bo in locker 15. Each name leads to one number, so the list is a function from members to locker numbers.

Now say the list gives Ana both locker 12 and locker 18. Look her up and you get two answers. One input has two outputs, so the list has stopped being a function.

A locker that changes by the day could still work. But then the input has to be the member and the day together.

Check yourselfWhich locker list fails to be a function from members to locker numbers?

Correct.Not quite. The answer is Ana gets 12 and Ana gets 18.

The same input, Ana, has two different outputs. Two members sharing locker 12 doesn't break the rule, because each of them still has one locker.

Put Ana and Bo both in locker 12. Look each of them up. Ana gets one number and so does Bo. Each input still has one output, so the list is still a function.

Whether two bags fit in one locker is a practical question. The definition only looks one way, from input to output. It doesn't require different inputs to get different outputs.

Numbers do the same thing. Take the rule "square the input," which means multiply it by itself. The input 3 gives 9. The input negative 3 also gives 9, because a negative times a negative is positive.

Squaring is still a function, because each input has one square. A function whose different inputs always give different outputs has an extra property called one-to-one. Squaring doesn't have it, and neither does the shared-locker list.

Try to recallWhy is squaring still a function, even though 3 and negative 3 both give 9?

Each input gives exactly one output. A function allows different inputs to share an output.

To test any rule, take one input at a time and ask whether it leads to one definite output. One input with two outputs breaks a function. Two inputs that share an output don't.

Lessons in this topic

  1. What makes a rule a function?

    A function gives each allowed input exactly one output. See what breaks that requirement, and why two inputs sharing an output doesn't.

    Essentials · 4 min

  2. How to read a formula, and where it stops applying

    Work out a simple cost function by substitution, then see why a formula can return a number for an input its model doesn't cover.

    Essentials · 4 min

  3. Can you run a function backward?

    Knowing a rule is a function doesn't let you work back from an output to its input. See when the reverse fails and how restricting the inputs repairs it.

    Deeper · 4 min

  4. When one rule feeds another, order matters

    Chain two functions so one output becomes the next input, then see why order and hidden domain limits matter.

    Deeper · 5 min

Three quick stories from this topic

The sub-zero sprint

A published trend line for Olympic 100-meter times dips below zero seconds around 2636

In 2004 a paper in Nature fitted straight lines to Olympic winning times and had women outrunning men at the 2156 Games. A letter in reply followed the same lines further. A formula returns a number for any input, even where it describes nothing.

What the paper did

The authors drew one best-fit straight line through the men's winning times and another through the women's. Extended forward, the two lines crossed at the 2156 Olympics.

Why the lines can't be trusted that far

A function's domain is the set of inputs it covers. Past the races the lines were fitted to, each prediction assumes the trend continues, and a time below zero shows it can't.

Coupon before or after shipping

A 20% coupon takes more off your bill when the shop applies it after adding shipping

Say the goods cost 10 euros and shipping costs 4. Coupon first, then shipping, comes to 12 euros. Shipping first, then coupon, comes to 11.20. The steps are the same, but the 20% comes off a bigger amount.

Each step is a function

Adding 4 euros is one rule and keeping 80% is another. Feeding one rule's output into the next is called composition.

Order is part of the rule

Composing two functions in the opposite order usually gives a different function. Here one order works out as 0.8 × c + 4 and the other as 0.8 × (c + 4).

Two square roots, one symbol

Every positive number has two square roots, but the square root symbol means only one

Both 3 and negative 3 square to 9. The symbol is defined as the nonnegative root, so the square root of 9 is 3 alone. That choice gives each input exactly one output, which is what makes the square root a function.

Squaring loses the sign

Squaring sends 3 and negative 3 to the same output. Working back from 9, nothing in the output says which of the two you started with.

The fix is a restriction

Allow only zero and the positive numbers as inputs, and each square comes from one input. The reverse rule then has a single answer.

Sources

This topic is part of From everyday numbers to proof, a guided path through related topics.

  • Linear versus exponential growth

    Linear growth adds the same amount at each step and exponential growth multiplies by the same factor. See why they look alike at first, how decay and compound interest follow the same rule, and where the number e comes from.

    4 lessons · 20 min

  • Logarithms, where one step means ten times as much

    A logarithm counts how many times you multiplied. See how that makes earthquake magnitudes, orders of magnitude and half-lives work, and why a scale built this way is easy to misread.

    4 lessons · 22 min

  • Variables and algebraic expressions

    Algebra uses letters to talk about numbers you don't know yet, or about all numbers at once. Learn to read an expression, turn a sentence into symbols, and simplify without changing what it says.

    4 lessons · 16 min

  • Solving equations

    An equation is a balance, and solving it means keeping the balance while you isolate the unknown. Learn which moves are allowed, how to check an answer, and how to spot an equation with no solution or with endlessly many.

    4 lessons · 16 min

  • Permutations and combinations

    Count possibilities without listing them. Learn when to multiply choices, when order matters and when it doesn't, and work out why a 6-from-49 lottery ticket has about a 1 in 14 million chance.

    4 lessons · 16 min

  • Percentages and why the base matters

    See why a 20% fall takes a 25% rise to undo, why 5% to 10% is both five points and a doubling, and why you can't average two percentages.

    4 lessons · 21 min

All mathematics & logic topics · Take the quiz