JW

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

10/3/2025

I remember getting introduced to functions many moons ago initially pre-algebra and then repeating the introductions again through algebra and calculus (and beyond). Functions seemed obvious yet a bit confusing as to why there was so much hubbabaloo over them. As I progressed throughout my mathematical journey into college and graduate school, I came to see that I was actually missing a lot of the core concepts around functions and I had to fill in the gaps.

What were the gaps? Well, I think they arose from the fact that I initially viewed functions as simple polynomial functions like f(x) = x^2 - 4. Even as I learned more functions like the exponential function and logarithm or the trigonometric functions, I just patched on additional rules to make them work. It wasn’t obvious that some of the issues I was struggling through went back to not understanding what a function really was.

Now we don’t need to dive into amazing mathematicalrigor to get a lot of background of functions, instead, having a wider swath of functions can help give more examples. One of my favorite books in mathematics is Counterexamples in Topology — basically it’s a book tabulating examples that violate naive intuition brought up by so-called nice functions.

I like to think of a function as a machine. You feed it an input, it grinds its gears, and the function pops out an output.

We’ll start with four honest, hard-working machines and one slightly mind-bending one.

Linear Functions

Linear functions are basically the most basic function. As an example, f(x) = 2x + 3. Push in a number, it stretches by 2, then shifts by 3. No nonsense.

xf(x)=2x+3
-2-1
03
4.512
Linear: multiply, then add.

Quadratic Function: f(x) = x^2

The quadratic function is the next function you might think about after the linear function. Simply take the input number and multiply it by itself. The thing to notice is that everything comes out nonnegative. Negatives get squared into positives; zero stays zero; positives remain positive.

xf(x)=x^2
-39
00
24
Quadratic: multiply a number by itself.

Rounding Function

We often learn about rounding in elementary school and don’t think a lot more about it. But you can treat rounding as a function: feed it any real number and it spits out an integer. Try 2.49, 2.5, 2.51 and watch it snap to an integer .

xf(x)=Round(x)
2.492
2.513
3.23
Rounding funciton: rounds to the nearest integer.

Reciprocal Function: f(x) = 1/x

The reciprocal function is pretty straight forward: just take a number and divide 1 by that number. The tricky thing about the reciprocal function is that it doesn’t work for one value: x = 0 where you try to divide 1 by 0 which obviously doesn’t work. This means there is a “do not feed” sign for x = 0. Everything else is fair game.

xf(x)=1/x
-2-0.5
0.254
0kaboom
Reciprocal function.

Domain and Range: What’s Allowed In, What Actually Comes Out

Every machine comes with two signs on the side. One says what you’re allowed to feed it. The other says what can possibly come out.

The domain tells you when the machine works. The range tells you what it’s capable of. It’s tempting to think of both as collections of numbers, but that’s not quite right. A domain or a range is a set—a list of all the things that fit the rule.

The Domain

Most machines are happy to take anything you throw at them. The linear, quadratic, and rounding machines all hum along smoothly for any real number. The reciprocal machine, however, has a fuse. Feed it zero and it blows up.

You can always make a machine fussier by restricting what it accepts—say, “only positive numbers” or “only integers”—but mathematicians usually prefer the broadest domain that still works.

FunctionDomain (words)Domain (symbols)
LinearAll real numbers
QuadraticAll real numbers
RoundingAll real numbers
ReciprocalAll real numbers except 0ℝ \ {0}
What each machine is willing to accept.

The Range

Now flip it around. What can actually come out of the machine?

The linear machine is generous—it can hit any real number you like. The quadratic one is more selective: it never spits out a negative. The rounding machine only returns whole numbers. The reciprocal one dodges zero entirely.

FunctionRange (words)Range (symbols)
LinearAll real numbers
QuadraticNonnegative real numbers[0, ∞)
RoundingIntegers
ReciprocalAll real numbers except 0ℝ \ {0}
What each machine is capable of producing.

Domains and Ranges as Machines Themselves

Here’s the twist mathematicians love. Those two labels—“domain” and “range”—aren’t just notes about a function. They’re new machines hiding inside the old ones. They take in an entire function and spit out a set.

The Domain Machine

Feed it a function, and it tells you what can safely go in.

InputOutput
Domain(Linear)
Domain(Quadratic)
Domain(Rounding)
Domain(Reciprocal)ℝ \ {0}
The domain machine inspecting other machines.

The Range Machine

Feed it a function, and it reports what that function can possibly produce.

InputOutput
Range(Linear)
Range(Quadratic)[0, ∞)
Range(Rounding)
Range(Reciprocal)ℝ \ {0}
The range machine examining other machines.

Machines About Machines

Now for the fun question: if “domain” and “range” are themselves machines, what are their domains and ranges?

Their inputs are all the possible functions you could feed them—every mathematical machine imaginable. That collection—the set of all functions—is their domain.

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

MachineDomainRange
Domain(·)All functionsAll sets
Range(·)All functionsAll sets
The machines that talk about other machines.

Why This Matters

Thinking this way—about machines that act on other machines—is the first step toward higher-level mathematics. Once you see it, you can’t unsee it. It’s the same idea that powers programming, calculus, and modern physics: one rule can take another rule as input.

So far, we’ve just been turning cranks and watching numbers pop out. But now we’ve peeked behind the curtain and found another set of cranks—ones that work on the machines themselves.

That’s the fun of mathematics. Once you understand a machine, you start wondering who built the machine that built it—and then you try to build that one too.