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.
| x | f(x)=2x+3 |
|---|---|
| -2 | -1 |
| 0 | 3 |
| 4.5 | 12 |
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.
| x | f(x)=x^2 |
|---|---|
| -3 | 9 |
| 0 | 0 |
| 2 | 4 |
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 .
| x | f(x)=Round(x) |
|---|---|
| 2.49 | 2 |
| 2.51 | 3 |
| 3.2 | 3 |
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.
| x | f(x)=1/x |
|---|---|
| -2 | -0.5 |
| 0.25 | 4 |
| 0 | kaboom |
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.
- Domain: what you’re allowed to put in. If it’s not listed here, don’t shove it into the gears.
- Range: what the machine can actually spit out after it does its work.
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.
| Function | Domain (words) | Domain (symbols) |
|---|---|---|
| Linear | All real numbers | ℝ |
| Quadratic | All real numbers | ℝ |
| Rounding | All real numbers | ℝ |
| Reciprocal | All real numbers except 0 | ℝ \ {0} |
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.
| Function | Range (words) | Range (symbols) |
|---|---|---|
| Linear | All real numbers | ℝ |
| Quadratic | Nonnegative real numbers | [0, ∞) |
| Rounding | Integers | ℤ |
| Reciprocal | All real numbers except 0 | ℝ \ {0} |
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.
| Input | Output |
|---|---|
| Domain(Linear) | ℝ |
| Domain(Quadratic) | ℝ |
| Domain(Rounding) | ℝ |
| Domain(Reciprocal) | ℝ \ {0} |
The Range Machine
Feed it a function, and it reports what that function can possibly produce.
| Input | Output |
|---|---|
| Range(Linear) | ℝ |
| Range(Quadratic) | [0, ∞) |
| Range(Rounding) | ℤ |
| Range(Reciprocal) | ℝ \ {0} |
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.
| Machine | Domain | Range |
|---|---|---|
| Domain(·) | All functions | All sets |
| Range(·) | All functions | All sets |
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.