Function: Notations and Rules
TLDR;
- A function is a relation where every input maps to exactly one output. This page covers the formal definition, standard notation like \( f(x) \), and the concepts of domain and range.
- You will learn the key types of functions: into, onto, one-to-one, restriction, and extension, each with concrete examples so you can identify them in practice.
- The guide also covers operations on functions (addition, subtraction, multiplication, division) and includes FAQs addressing the most common points of confusion.
What is a Function?
A function is a special kind of relation where every input gives you exactly one output. If you pick any element from the domain and run it through the function, you always land on a single, definite value. There is no ambiguity, no branching into two different results.
Formally, \( f \) is a function if and only if two conditions hold:
- Every member of \( f \) is an ordered pair. That is, \( xfy \Rightarrow (x, y) \in f \).
- If both \( (x, y) \in f \) and \( (x, z) \in f \), then \( y = z \). No input maps to two different outputs.
Here is a quick way to think about it. Consider the set \( f = \{(1, 3), (2, 5), (3, 7)\} \). Each first coordinate (1, 2, 3) appears exactly once, so this is a valid function. But if you had \( g = \{(1, 3), (1, 5), (2, 7)\} \), the input 1 maps to both 3 and 5. That violates the second condition, so \( g \) is not a function.
Notation for Functions
When you write \( (x, y) \in f \), you are saying that the ordered pair \( (x, y) \) belongs to the function \( f \). Here, \( x \) is the argument (or input) and \( y \) is the image (or output). The older notation \( xfy \) expresses the same relationship, though you will rarely see it in modern textbooks.
The set of all valid arguments is called the domain of the function, and the set of all images (the actual outputs you get) is called the range. Keep these two terms sharp in your mind because they come up constantly.
Several equivalent notations exist for expressing \( (x, y) \in f \):
- \( y = f(x) \) is the standard modern notation you will use most often.
- \( y = fx \) is a shorthand sometimes used in algebra and analysis.
- \( y : xf \) and \( y = x^f \) are older notational forms you may encounter in classical texts.
For example, if \( f(x) = 2x + 1 \), then \( f(3) = 7 \). The argument is 3, the image is 7, and you write \( (3, 7) \in f \).
Domain and Range
The domain of a function \( f \) is the set of all inputs for which \( f \) is defined. The range (also called the image) is the set of all outputs that \( f \) actually produces. These are not the same as the codomain, which is the larger set that the range sits inside.
Consider \( f(x) = x^2 \) where \( x \in \mathbb{R} \). The domain is all of \( \mathbb{R} \), but the range is only \( [0, \infty) \) because squaring a real number never gives a negative result. If you are told that \( f : \mathbb{R} \to \mathbb{R} \), the codomain is \( \mathbb{R} \), but the range is still just the non-negative reals.
Understanding this distinction is critical. When you encounter a function, your first question should always be: what is its domain, and what values does it actually take?
Into Function
A function \( f \) is said to be into \( Y \) if the range of \( f \) is a subset of \( Y \), but does not necessarily cover all of \( Y \). In set notation, \( R_f \subset Y \). Some elements of \( Y \) are left “unhit” by the function.
For example, let \( f : \{1, 2, 3\} \to \{a, b, c, d\} \) be defined by \( f(1) = a \), \( f(2) = b \), \( f(3) = c \). The range is \( \{a, b, c\} \), which is a proper subset of the codomain \( \{a, b, c, d\} \). The element \( d \) has no preimage, so \( f \) is an into function. You can think of it as a function that maps “into” the codomain without filling it completely.
Onto Function
A function \( f \) is onto \( Y \) (also called surjective) if the range of \( f \) equals \( Y \) exactly. In set notation, \( R_f = Y \). Every element in the codomain is hit by at least one element from the domain.
For example, let \( g : \{1, 2, 3, 4\} \to \{a, b, c\} \) be defined by \( g(1) = a \), \( g(2) = b \), \( g(3) = c \), \( g(4) = a \). The range is \( \{a, b, c\} \), which equals the codomain. Every element in the codomain has at least one preimage, so \( g \) is onto. Notice that \( a \) is hit twice, that is perfectly fine for a surjection.
The general notation for a mapping is \( f : X \to Y \), where \( X \) is the domain and \( Y \) is the codomain. Whether the function is into or onto depends on whether the range fills up all of \( Y \).
One-to-One Function
A function is one-to-one (also called injective) if it maps distinct elements to distinct elements. No two different inputs ever produce the same output. Formally, \( f \) is one-to-one if and only if \( x_1 \ne x_2 \Rightarrow f(x_1) \ne f(x_2) \). Equivalently, \( f(x_1) = f(x_2) \Rightarrow x_1 = x_2 \).
Consider \( f(x) = 3x + 2 \) defined on \( \mathbb{R} \). If \( f(x_1) = f(x_2) \), then \( 3x_1 + 2 = 3x_2 + 2 \), which gives \( x_1 = x_2 \). So \( f \) is one-to-one. Now consider \( g(x) = x^2 \) on \( \mathbb{R} \). Here \( g(2) = 4 \) and \( g(-2) = 4 \), so two different inputs give the same output. This function is not one-to-one.
A function that is both one-to-one and onto is called a bijection. Bijections are especially important because they have inverses: you can uniquely reverse the mapping from output back to input.
Restriction of a Function
If you have a function \( f : X \to Y \) and you want to limit its domain to a smaller set \( A \subseteq X \), you get the restriction of \( f \) to \( A \). Formally, the restriction is \( f \cap (A \times Y) \), which is usually written as \( f|_A \). It is still a function from \( A \) into \( Y \), but it only “sees” the inputs in \( A \).
For example, let \( f : \mathbb{R} \to \mathbb{R} \) be defined by \( f(x) = x^2 \). If you restrict \( f \) to \( A = [0, \infty) \), you get \( f|_{[0,\infty)}(x) = x^2 \) for \( x \ge 0 \). This restricted version is actually one-to-one (since you have removed the negative inputs that caused duplicates), and it is a common technique for making a function invertible.
Extension of a Function
An extension goes in the opposite direction. A function \( f \) is an extension of a function \( g \) if \( g \subseteq f \), meaning that \( f \) agrees with \( g \) everywhere that \( g \) is defined, but \( f \) may also be defined on additional inputs outside the domain of \( g \).
For example, let \( g : \{1, 2\} \to \mathbb{R} \) with \( g(1) = 5 \) and \( g(2) = 8 \). Now define \( f : \{1, 2, 3\} \to \mathbb{R} \) with \( f(1) = 5 \), \( f(2) = 8 \), and \( f(3) = 11 \). Since \( f \) matches \( g \) on inputs 1 and 2 and adds a new mapping for 3, we say \( f \) is an extension of \( g \). Conversely, \( g \) is the restriction of \( f \) to \( \{1, 2\} \). These two concepts are mirror images of each other.
Operations on Functions
Once you have two functions defined on the same domain, you can combine them using arithmetic operations. If \( f \) and \( g \) are both functions from \( X \) to \( \mathbb{R} \), you can define the following:
- Addition: \( (f + g)(x) = f(x) + g(x) \)
- Subtraction: \( (f – g)(x) = f(x) – g(x) \)
- Multiplication: \( (f \cdot g)(x) = f(x) \cdot g(x) \)
- Division: \( \left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)} \), provided \( g(x) \ne 0 \)
The domain of the combined function is the intersection of the domains of \( f \) and \( g \). For division, you must also exclude any \( x \) where \( g(x) = 0 \).
As a concrete example, let \( f(x) = x + 1 \) and \( g(x) = x – 2 \), both defined on \( \mathbb{R} \). Then \( (f + g)(x) = 2x – 1 \), \( (f \cdot g)(x) = (x+1)(x-2) = x^2 – x – 2 \), and \( \left(\frac{f}{g}\right)(x) = \frac{x+1}{x-2} \) for all \( x \ne 2 \).
Key Takeaways
Here are the main ideas you should carry away from this page:
- A function maps each input to exactly one output. The uniqueness of the output is what distinguishes a function from a general relation.
- The standard notation \( y = f(x) \) tells you that \( x \) is the input and \( y \) is the output. The domain is the set of valid inputs, and the range is the set of actual outputs.
- An into function does not cover its entire codomain. An onto (surjective) function does.
- A one-to-one (injective) function never sends two different inputs to the same output. A function that is both one-to-one and onto is a bijection.
- Restriction shrinks the domain. Extension expands it. These are inverse operations and are commonly used to make functions invertible or to define piecewise behavior.
- You can add, subtract, multiply, and divide functions, as long as you respect the domains. For division, always exclude points where the denominator is zero.
Frequently Asked Questions
What is the difference between a function and a relation?
A relation is any set of ordered pairs. A function is a special type of relation where each input (first coordinate) appears in exactly one ordered pair. In other words, every input maps to one and only one output. The set {(1, 2), (1, 3)} is a valid relation but not a function because the input 1 has two different outputs.
What is the difference between range and codomain?
The codomain is the set that you declare as the target of a function when you write f : X → Y. The range (or image) is the subset of the codomain that the function actually hits. For example, if f(x) = x² maps from the reals to the reals, the codomain is all of R, but the range is only [0, ∞). The range is always a subset of the codomain, and they are equal only when the function is onto (surjective).
How can you tell if a function is one-to-one from its graph?
Use the horizontal line test. Draw horizontal lines across the graph. If every horizontal line intersects the graph at most once, the function is one-to-one. If any horizontal line crosses the graph more than once, there are two different inputs producing the same output, and the function fails to be injective. For example, f(x) = x³ passes the horizontal line test, but f(x) = x² does not because horizontal lines above zero cross the parabola at two points.
Why would you restrict a function to a smaller domain?
The most common reason is to make a function invertible. A function must be one-to-one (injective) to have an inverse, and many standard functions like x², sin(x), and cos(x) are not one-to-one on their full natural domain. By restricting x² to [0, ∞), or sin(x) to [-π/2, π/2], you eliminate the duplicate outputs and obtain a one-to-one function that can be properly inverted. This is exactly how inverse functions like √x and arcsin(x) are defined.
What does it mean for a function to be a bijection?
A bijection is a function that is both one-to-one (injective) and onto (surjective). This means every output in the codomain is hit by exactly one input from the domain. Bijections set up a perfect pairing between the domain and codomain, and they are the only functions that have a true two-sided inverse. For example, f(x) = 2x + 3 from R to R is a bijection because every real number is hit exactly once.
What happens to the domain when you divide two functions?
When you form the quotient (f/g)(x) = f(x)/g(x), the domain is the intersection of the domains of f and g, minus any points where g(x) = 0. You must exclude those points because division by zero is undefined. For instance, if f(x) = x + 1 and g(x) = x – 3, both defined on all of R, then (f/g)(x) = (x+1)/(x-3) is defined for all real numbers except x = 3.
I come back to this page every time I need to revise function notation. It is one of the most reliable resources I have found online.
I’ve been struggling with function notation for weeks and this finally made it click. The worked examples are particularly helpful.
The section on one-to-one and onto functions was eye-opening. I never thought about it from that angle before. Thank you for this resource.
I’m preparing for competitive exams and this function notation guide has been incredibly useful. The proofs are well-structured.
The FAQs at the bottom cleared up some misconceptions I had about function notation. Really thoughtful addition.
Shared this with my study group. We all found the one-to-one and onto functions section very helpful for our assignments.
This is better than most paid courses I’ve taken on function notation. Clear, concise, and well-organized.
The examples here really bridge the gap between theory and problem-solving. Helped me a lot with my homework.
Finally a resource that explains function notation without assuming you already know everything. Perfect for self-study.
I’ve been struggling with function notation for weeks and this finally made it click. The worked examples are particularly helpful.
Bookmarked this page. Your way of explaining function notation is clear and straightforward. Would love to see more examples with solutions.
Shared this with my study group. We all found the one-to-one and onto functions section very helpful for our assignments.
This explanation of function notation is exactly what I needed for my semester exams. The step-by-step approach makes it so much easier to follow than my textbook.
Could you add more practice problems at the end? The content is excellent, I just want more to work through.
The FAQs at the bottom cleared up some misconceptions I had about function notation. Really thoughtful addition.
I wish I had found this during my first year. The way you break down function notation makes complex concepts feel approachable.