JW

Functions, Domains, and Ranges — the Machines Behind the Curtain

1/10/2026

The jump from algebra to higher mathematics is just one idea: a function can eat another function.

Every function is a machine: shove something in, something comes out. But the most interesting machines don’t chew on numbers — they chew on other machines. Domain and range, which look like labels, are actually functions that take a function as input and return a set. The derivative does the same thing. Once you see it, the door to calculus, topology, and modern mathematics swings open.

Every Function Is a Machine

You know what a function is. You’ve been told since algebra class. But here’s the version that actually sticks: a function is a machine. You shove something in, gears turn, something comes out. That’s it. The input goes in one end, the output comes out the other, and the machine never gives you two different answers for the same input.

Simple enough. But here’s what nobody tells you in algebra: the most interesting machines aren’t the ones that chew on numbers. They’re the ones that chew on other machines. We’ll get there. First, let’s meet some machines.

Five Machines

The Linear Machine: f(x) = 2x + 3

The simplest machine you can build. Shove in a number, it stretches by 2, shifts by 3, done. No surprises. Feed it anything, get something back every time.

InOut
-2-1
03
4.512
Multiply, then add. Every time.

The Squaring Machine: f(x) = x²

This one takes a number and multiplies it by itself. Watch what happens: negatives become positive, positives stay positive, and zero just sits there. Nothing negative ever comes out. Remember that.

InOut
-39
00
24
Everything comes out nonnegative. Always.

The Rounding Machine

You’ve been rounding since elementary school. You just didn’t know it was a function. Feed it any real number, and it snaps to the nearest integer. Try 2.49: you get 2. Try 2.51: you get 3. The output is always a clean integer.

InOut
2.492
2.513
3.23
Decimals go in, integers come out.

Now watch something sneaky. Walk toward 2.5 from the left: 2.49 rounds to 2. So does 2.499. So does 2.4999. You can get as close to 2.5 as you want and the output stays at 2. Now approach from the right: 2.51 rounds to 3. So does 2.501. So does 2.5001. Inputs that are almost identical produce outputs that jump by a whole integer. The machine’s output breaks instead of sliding smoothly. Mathematicians call that a discontinuity, and an entire branch of mathematics — topology — is built around understanding which functions break and which don’t.

The Reciprocal Machine: f(x) = 1/x

Take a number, divide 1 by it. Easy. Except for one tiny problem: try feeding it zero.

InOut
-2-0.5
0.254
0KABOOM
Works great. Unless you feed it zero. Don’t feed it zero.

This machine has a “do not feed” sign, and the sign says 0. Everything else? Fine. Zero? The gears jam, smoke comes out, the machine refuses. This is going to matter in a second.

The Sign Machine

Here’s one that breaks a common misconception. Most people think every function has a formula with x’s and exponents. Not this one. The sign machine has a simple rule: feed it a positive number, it returns 1. Feed it a negative number, it returns -1. Feed it zero, it returns 0. That’s the whole machine. No formula, just a rule.

InOut
421
-0.003-1
00
1,000,0001
No formula. Just: positive → 1, negative → -1, zero → 0.

This matters because it shows that functions are far broader than what you see in algebra class. A function is anything that takes an input and produces exactly one output. It doesn’t need to be a nice curve you can draw. Mathematicians work with functions so weird they can’t be graphed at all — like one that returns 1 for every fraction and 0 for every irrational number. Still a valid function. Still follows the one-input-one-output rule. You just can’t picture it.

Two Signs on Every Machine

Every machine comes with two labels bolted to the side:

Look at our 5 machines. Four of them will eat any real number you throw at them. The reciprocal machine won’t touch zero. That’s a domain difference.

MachineDomainIn symbols
LinearAny real number
SquaringAny real number
RoundingAny real number
ReciprocalAny real number except 0ℝ \ {0}
SignAny real number
What each machine will accept.

Now flip it. What comes out?

The linear machine can produce any real number. The squaring machine? Never anything negative. The rounding machine? Only integers. The reciprocal machine? Everything except zero. The sign machine? Just three values: -1, 0, and 1.

MachineRangeIn symbols
LinearAny real number
SquaringNonnegative reals only[0, ∞)
RoundingIntegers only
ReciprocalAny real number except 0ℝ \ {0}
SignJust -1, 0, and 1{-1, 0, 1}
What each machine can produce.

Every machine has a personality. The domain is what it will accept; the range is what it’s capable of. Most algebra classes stop here. That’s a mistake. Because here’s where it gets good.

The Trick: Domain and Range Are Machines Too

Read that heading again. Domain and range aren’t just labels. They’re machines.

Think about what “domain” actually does. You hand it a function — a whole machine — and it hands you back a set. The set of everything that machine will accept. Domain takes the linear machine and returns “all real numbers.” Domain takes the reciprocal machine and returns “all real numbers except zero.”

It takes in a machine. It spits out a set. That’s a function.

Feed the Domain MachineIt returns
Linear
Squaring
Rounding
Reciprocalℝ \ {0}
Sign
The Domain machine: feed it a function, get back a set.

Range works the same way. Hand it any machine, and it tells you what that machine can produce.

Feed the Range MachineIt returns
Linear
Squaring[0, ∞)
Rounding
Reciprocalℝ \ {0}
Sign{-1, 0, 1}
The Range machine: feed it a function, get back a set.

Now here’s the question that should make your brain itch: if Domain and Range are machines, what are their domains and ranges?

Their inputs are functions. Not numbers — functions. Every function you could possibly build is something you could feed into the Domain machine or the Range machine. So their domain is the set of all functions.

Their outputs are sets: sometimes all real numbers, sometimes just the integers, sometimes something weirder. Collect all those possible outputs together and you get their range: the set of all sets.

MachineIts DomainIts Range
Domain(·)All functionsAll sets
Range(·)All functionsAll sets
Machines that inspect other machines.

One More Machine: The Derivative

If you’ve taken calculus, you’ve already met another machine that eats machines. The derivative. Feed it a function, and it hands you back a different function — the one that describes how fast the original is changing.

Feed the Derivative MachineIt returns
2x
3x²
sin(x)cos(x)
Function in, function out. The derivative is a machine that eats machines.

Now here’s a question: what’s the domain of the derivative machine? It’s pickier than Domain or Range. You can feed Domain any function and it will happily report a set. But the derivative machine won’t accept just anything. Feed it a function with a sharp corner or a sudden jump — like our rounding machine — and it chokes. The derivative only works on functions that are smooth enough. Its domain is “differentiable functions,” a smaller collection than “all functions.” Even machines that eat machines have their limits.

Why This Is a Big Deal (and a Warning at the Edge)

We started with machines that eat numbers. Then we found machines that eat machines: Domain, Range, and the Derivative. That jump, from functions on numbers to functions on functions, is the jump from algebra to higher mathematics. It’s the same idea that powers calculus, programming, and modern physics. Nothing here requires anything beyond algebra. The machines are right there on the table. You just have to notice that the labels on the side are machines too.

But there’s a warning. We said the range of the Domain machine is “all sets.” That sounds fine until you ask a dangerous question: is the collection of all sets itself a set? If so, does it contain itself? Now consider a weirder collection: the set of all sets that don’t contain themselves. Does that one contain itself? If it does, then by definition it shouldn’t. If it doesn’t, then by definition it should. Your brain should hurt.

That’s Russell’s paradox, and it forced mathematicians in the early 1900s to tear down and rebuild the foundations of set theory. The thread we’ve been pulling — machines on machines, sets of sets — leads right to the edge of a cliff. That’s not a reason to stop pulling. It’s the reason mathematics is still being built.