Types of functions
Given a function , can you tell — just from the rule and the stated domain and codomain — whether every output is hit exactly once, whether every element of is hit at all, both, or neither? This is the second big theme of Class 12's Relations and Functions chapter: classifying a function as one-one (injective), onto (surjective), both (a bijection), or neither. You already know what a function is from Class 11; now you learn the precise algebraic tests — proving one-one via the implication , and proving onto by solving for an arbitrary in the codomain — plus the sharper habit of disproving each property with a single well-chosen counterexample. The codomain, not just the formula, decides these properties, and that single fact is where most marks are lost or won.
A function is one-one when distinct inputs never collide in the output, and onto when every element of the stated codomain is actually reached, so classifying always requires checking both the rule and the exact codomain together, never the rule alone.
The core idea
Let be a function, with the domain and the stated codomain.
One-one (injective). never sends two different inputs to the same output:
where: are arbitrary elements of the domain , and the implication must hold for every such pair, not just a few numbers you happened to try. Equivalently, distinct elements of have distinct images in . Graphically, for a real function, every horizontal line crosses the graph in at most one point (the horizontal line test).
Onto (surjective). Every element of the codomain is actually reached by some input:
where: ranges over the whole codomain , and must come from the domain . Equivalently, the range of (the set of actual outputs) equals the codomain . If even one element of is missed, is not onto — older texts call this case "into." A function can be one-one only, onto only, both (a bijection), or neither, and all four combinations genuinely occur. Crucially, the same formula can change category when the codomain changes: from to misses every negative number, so it is not onto, but the identical rule from to hits every non-negative number, so it becomes onto. The rule alone never settles the question — you must read the stated codomain every time. To disprove one-one, it is enough to exhibit one pair of distinct inputs with equal outputs. To disprove onto, it is enough to exhibit one element of the codomain with no pre-image. Proving the positive statement, by contrast, needs a general argument valid for all elements — a single lucky example never proves one-one or onto.
The goal is to prove, in full generality and not just for one numerical example, that any real linear function with , mapping , is simultaneously one-one and onto — a single argument that covers every such line at once, rather than re-deriving the two properties from scratch each time a new slope and intercept appear in a problem.
Step 1. Set up the one-one test. Suppose for arbitrary . By the rule, .
Step 2. Simplify the equality. Subtracting from both sides gives . Since , division by is valid, giving . So forces for arbitrary , which is exactly the definition of one-one — no counterexample exists because the algebra rules one out for every pair.
Step 3. Set up the onto test. Take an arbitrary , the codomain. We must find some with , i.e. solve for .
Step 4. Solve and verify. Since , is a well-defined real number for every real . Substituting back, . So every has a pre-image in , proving is onto.
Step 5. Combine. Because is both one-one and onto, () is a bijection on for every choice of slope and intercept — the condition is exactly what Step 2's division needs, and it is the only thing that can ever go wrong.
Worked example
Let be defined by . Determine whether is one-one, onto, both, or neither, and state what happens if the codomain is changed to .
Step 1. Test one-one with a counterexample. Take and ; both lie in the domain and . But and , so despite . This single pair is enough: is not one-one.
Step 2. Test onto against the stated codomain . The codomain includes negative numbers, e.g. . Solving for real is impossible, since the square of any real number is never negative. So has no pre-image, and is not onto on .
Step 3. Change only the codomain to , keeping the same rule and domain. Now take an arbitrary ; since , is a real number and . Every in this smaller codomain now has a pre-image, so the same rule is onto once the codomain is restricted. One-one-ness is unaffected by the codomain change, so is still not one-one — it remains onto but not one-one on .
Answer: from is neither one-one nor onto, but the identical rule from is onto (still not one-one).
Competitive stretch
If instead the domain is also restricted to , with codomain , then becomes a full bijection: Step 1's counterexample is no longer in the domain, so distinct non-negative inputs give distinct squares, and Step 3's construction still supplies every non-negative output. Restricting both sides at once can restore both properties that restricting the codomain alone only partly fixed.
Common traps
- Testing a handful of numeric inputs and declaring "one-one" without the general implication for arbitrary — a few matching outputs prove nothing either way.
- Ignoring the stated codomain when judging "onto" — the same formula can be onto or not depending on whether the codomain is , , or something else; always compare the actual range to the given codomain, not to what looks natural.
- Mixing up the vertical line test (confirms is a valid function at all) with the horizontal line test (checks one-one-ness) — only the horizontal test is relevant here.
- Assuming any "nice" polynomial formula is automatically onto — , , and even restricted to a smaller codomain than its true range are not onto unless the range genuinely equals the stated codomain.
Ask the tutor: Not sure whether a specific function — piecewise, or built from or — is one-one, onto, both, or neither? Ask the AI tutor to walk through the test with you step by step.
Why does the codomain matter if the rule of the function stays exactly the same?
Because one-one is about the domain (do inputs collide) while onto compares the range to the codomain (is every stated target hit). Changing the codomain does not touch the rule or the domain, so one-one-ness never changes with it, but onto-ness is defined entirely relative to the codomain you were given. from misses every negative number and fails onto, yet the same rule from hits everything in that smaller codomain and passes. Always check the codomain stated in the question, not the one you assume.
Is it enough to test one-one and onto using a graph, or do I need algebra?
A graph (via the horizontal line test) is a fast sanity check and can be enough to disprove one-one by spotting a horizontal line that crosses twice. But CBSE board answers expect the algebraic argument: assume and show it forces for one-one, or solve for in terms of an arbitrary for onto. A picture supports intuition; the implication and the explicit solving are what earn full marks.
Do I need to know about inverse functions to answer these questions?
No. This topic asks you to classify a given function as one-one, onto, both, or neither using direct tests on the stated rule, domain and codomain. Building the machinery of inverse functions from a bijection is not part of the current syllabus here, so you will not be asked to construct from this topic — focus stays on the injectivity and surjectivity tests themselves.