2.3 Functions and Their Graphs
A function is a relation in which every input has exactly one output. Real functions have graphs, and seven standard ones โ identity, constant, polynomial, rational, modulus, signum and greatest integer $[x]$ โ are the building blocks for everything that follows.
Type a number into a calculator and press $x^2$: you always get one answer, and the same input always gives the same answer. Feed a student's marks into a grading table and out comes exactly one grade. A rule that produces a single, definite output for every allowed input is called a function, and it is the most important idea in school mathematics โ the formula $A=\pi r^2$, the conversion $F=\tfrac95C+32$, and the price of a taxi ride as a function of distance are all examples.
In Section 2.2 a relation could send an element to several partners, or to none. A function is the special relation that does neither. In this section we define functions precisely, learn to find the domain and range of a real function given by a formula, and draw the graphs of the standard real functions. Two of them, the modulus function $|x|$ and the greatest integer function $[x]$, have corners and jumps that make them favourites of both Board and JEE examiners.
Functions
A relation $f$ from a non-empty set $A$ to a non-empty set $B$ is called a function (or map) from $A$ to $B$, written $f : A\to B$, if every element of $A$ has exactly one image in $B$. The image of $x$ is written $f(x)$ ("$f$ of $x$"), so $(x,y)\in f$ means $y=f(x)$.
The set $A$ is the domain of $f$, $B$ is its codomain, and the set of all images $\{f(x) : x\in A\}$ is its range, a subset of $B$.
Two things can stop a relation from being a function: an element of $A$ with no image, or an element of $A$ with two or more images. In an arrow diagram, a function has exactly one arrow leaving each element of $A$. Several arrows may arrive at the same element of $B$, and some elements of $B$ may receive none โ both are allowed.
(a) $R_1=\{(1,1),(2,4),(3,9),(4,16)\}$ (b) $R_2=\{(1,1),(2,4),(2,9),(3,9),(4,16)\}$ (c) $R_3=\{(1,4),(2,4),(3,4),(4,4)\}$ (d) $R_4=\{(1,1),(2,4),(4,16)\}$
(b) $g : \mathbb{N}\to\mathbb{N}$ is given by $g(x)=2x+1$. Find $g(1)$, $g(10)$, and the range of $g$. Is $8$ an image?
Real Functions, Their Domains and Ranges
A function whose codomain is $\mathbb{R}$ (or a subset of it) is a real-valued function; if its domain is also a subset of $\mathbb{R}$, it is a real function.
When a real function is given only by a formula, such as $f(x)=\dfrac{1}{x-3}$, we agree that its domain is the largest set of real numbers $x$ for which the formula gives a real number. To find it, remove from $\mathbb{R}$ every $x$ that makes a denominator zero or puts a negative number under a square root.
The graph of a real function $f$ is the set $\{(x,f(x)) : x \text{ in the domain}\}$ โ a subset of $\mathbb{R}\times\mathbb{R}$, drawn in the Cartesian plane. To find the range, set $y=f(x)$ and ask which values of $y$ can actually occur โ often by solving for $x$ in terms of $y$.
A set $G$ of points in the Cartesian plane is the graph of a function of $x$ (with $y$ the output) if and only if no vertical line meets $G$ in more than one point.
Proof. The vertical line $x=a$ meets $G$ at the points $(a,y)\in G$. If $G$ is the graph of a function $f$, the only such point is $(a,f(a))$ โ or none if $a$ is outside the domain. Conversely, if every vertical line meets $G$ at most once, then each $a$ that occurs as a first component has exactly one partner $y$, so $G$ defines a function on the set of these $a$. $\blacksquare$
The Standard Real Functions and Their Graphs
A handful of functions appear so often that they have names. Learn their graphs well: almost every function you meet later is built from them.
- Identity function: $f : \mathbb{R}\to\mathbb{R}$, $f(x)=x$. Domain and range $\mathbb{R}$; graph: the line $y=x$ through the origin at $45^\circ$.
- Constant function: $f : \mathbb{R}\to\mathbb{R}$, $f(x)=c$ for a fixed real $c$. Domain $\mathbb{R}$, range $\{c\}$; graph: the horizontal line $y=c$.
- Polynomial function: $f(x)=a_0+a_1x+a_2x^2+\cdots+a_nx^n$ with $n$ a non-negative integer and $a_0,a_1,\dots,a_n\in\mathbb{R}$. Domain $\mathbb{R}$. Examples: $x^2$, $x^3-3x$, $2x+5$. ($\sqrt x$ and $x^{-1}$ are not polynomials.)
- Rational function: $f(x)=\dfrac{p(x)}{q(x)}$ with $p$, $q$ polynomials; domain $\{x\in\mathbb{R} : q(x)\ne0\}$. Example: $f(x)=\dfrac1x$, with domain and range $\mathbb{R}-\{0\}$.
- Modulus function: $f(x)=|x|=\begin{cases}x, & x\ge0\\ -x, & x\lt0.\end{cases}$ Domain $\mathbb{R}$, range $[0,\infty)$. Graph: a "V" with its corner at the origin.
- Signum function: $f(x)=\operatorname{sgn}x=\begin{cases}1, & x\gt0\\ 0, & x=0\\ -1, & x\lt0.\end{cases}$ Domain $\mathbb{R}$, range $\{-1,0,1\}$. For $x\ne0$, $\operatorname{sgn}x=\dfrac{|x|}{x}$.
- Greatest integer function: $f(x)=[x]$, the greatest integer less than or equal to $x$. Domain $\mathbb{R}$, range $\mathbb{Z}$. If $n\in\mathbb{Z}$ then $[x]=n$ exactly when $n\le x\lt n+1$, so the graph is a staircase: a horizontal step on each interval $[n,n+1)$, filled at its left end and hollow at its right end.
(b) Solve $[x]=2$ and $[x]=-1$.
(c) Show that $\operatorname{sgn}x\cdot|x|=x$ for every real $x$.
1. $[x]$ of a negative number. $[-2.7]=-3$, not $-2$. "Greatest integer not exceeding" means rounding down, towards $-\infty$, not chopping off the decimals.
2. Range is not codomain. $f : \mathbb{R}\to\mathbb{R}$, $f(x)=x^2$, has codomain $\mathbb{R}$ but range $[0,\infty)$.
3. Two inputs, one output is fine. $f(2)=f(-2)=4$ does not stop $x^2$ being a function. One input with two outputs does.
4. Do not cancel before finding the domain. $\dfrac{x^2-1}{x-1}$ has domain $\mathbb{R}-\{1\}$, even though it equals $x+1$ wherever it is defined.
5. $|x|$ is not "$x$ without its sign" for expressions. $|x-3|=x-3$ only when $x\ge3$; for $x\lt3$ it is $3-x$.
In JEE Main and JEE Advanced 2026; the CBSE year-end exam asks only for domains and ranges of simple functions. Both entrance exams regularly ask for the domain and range of expressions built from several standard functions.
Method. Write down every condition the expression needs (denominators $\ne0$, quantities under a square root $\ge0$), solve them together, and intersect the solution sets. For the range, set $y=f(x)$ and find which $y$ make the equation solvable for an allowed $x$.
Worked example. Find the domain and range of $f(x)=\sqrt{16-x^2}$.
Solution. We need $16-x^2\ge0$, i.e. $x^2\le16$, i.e. $-4\le x\le4$: domain $[-4,4]$. As $x$ runs over $[-4,4]$, $x^2$ takes every value in $[0,16]$, so $16-x^2$ takes every value in $[0,16]$ and $f(x)$ every value in $[0,4]$: range $[0,4]$. (The graph is the upper half of the circle $x^2+y^2=16$.)
Exercises
- 1 $\{(1,2),(2,3),(3,4)\}$
- 2 $\{(1,2),(1,3),(2,4),(3,4)\}$
- 3 $\{(1,5),(2,5),(3,5)\}$
- 4 $\{(1,2),(3,4)\}$
- 5 Is $\{(x,y) : x\in\mathbb{Z},\ y=x^2\}$ a function from $\mathbb{Z}$ to $\mathbb{Z}$? If so, what is its range?
- 6 Is $\{(x,y) : x,y\in\mathbb{Z},\ x=y^2,\ 0\le x\le9\}$ a function (of $x$)? Explain.
- 7 Use the vertical line test to decide whether the circle $x^2+y^2=1$ is the graph of a function of $x$.
- 1 $f(x)=x^2-3x+2$. Find $f(0)$, $f(-1)$ and $f\big(\tfrac32\big)$.
- 2 $f(x)=2x+3$ with domain $\{-1,0,1,2\}$. Find the range of $f$.
- 3 Find the domain of $f(x)=\dfrac{1}{x-4}$.
- 4 Find the domain of $f(x)=\dfrac{x+2}{x^2-7x+10}$.
- 5 Find the domain and range of $f(x)=\sqrt{x+3}$.
- 6 Find the domain and range of $f(x)=|x-2|$.
- 7 Find the range of $f(x)=3-x^2$, $x\in\mathbb{R}$.
- 8 Find the range of $f(x)=\dfrac1x$, $x\ne0$, and the values of $x$ with $f(x)=4$.
- 9 $f(x)=x+\dfrac1x$ for $x\ne0$. Show that $f(x)=f\big(\tfrac1x\big)$.
- 1 Evaluate $[3.9]$, $[-3.9]$, $[-4]$, $[0.01]$, $[-0.01]$.
- 2 Evaluate $\operatorname{sgn}(-7)$, $\operatorname{sgn}0$, $\operatorname{sgn}(2.5)$.
- 3 Evaluate $|{-5}|+|3-8|$.
- 4 Solve $[x]=-2$.
- 5 Solve $|x|=3$ and $|x-1|=2$.
- 6 Show that $[x+1]=[x]+1$ for every real $x$.
- 7 Is $[2x]=2[x]$ for every real $x$? Prove it or give a counterexample.
- 8 Find the domain and range of $f(x)=\dfrac{x}{|x|}$.
- 9 Sketch $f(x)=x^3$ for $-2\le x\le2$ from a table of values, and state its range on that interval.
- 1 $f(x)=\begin{cases}-x, & x\lt0\\ x^2, & 0\le x\le2\\ 4, & x\gt2.\end{cases}$ Find $f(-3)$, $f(1)$, $f(2)$, $f(5)$ and the range of $f$.
- 2 Parking. A mall charges $P(t)=20+15[t]$ rupees for parking $t$ hours. Find $P(0.5)$, $P(2)$ and $P(2.99)$. How long can you park for โน50?
- 3 Temperature. $F(C)=\tfrac95C+32$ converts ยฐC to ยฐF. Find $F(37)$, and the temperature at which both scales show the same number.
- 4 Area. Express the area $A$ of a square as a function of its side $s$, with domain and range. Is the side a function of the area?
- 5 Distance. $f(x)=|x-3|$ is the distance on the number line from $x$ to $3$. Use this meaning to solve $f(x)=5$ and $f(x)=0$, and explain why $f(x)=-1$ has no solution.
How this is examined: Board papers ask for values of $[x]$, $|x|$ and $\operatorname{sgn}x$ (1 mark), the domain and range of simple real functions (2 marks), and case studies built on a real-life step or piecewise function. JEE tests the definition of a function and domains of expressions combining the standard functions.
E1. Board ยท 1 mark The value of $[-2.3]+[2.3]$ is (A) $0$ (B) $-1$ (C) $1$ (D) $-5$
E2. Board ยท 2 marks Find the domain and range of (i) $f(x)=\dfrac{1}{2-x}$ (ii) $g(x)=|x+1|$.
E3. Board ยท Case study A city car park charges $P(t)=30+20[t]$ rupees for a stay of $t$ hours, where $0\lt t\lt6$. (i) Find $P(0.9)$ and $P(2.5)$. (2 marks) (ii) Write the range of $P$. (1 mark) (iii) Is $P$ a function of $t$? Is $t$ a function of $P$? Justify. (1 mark)
E4. JEE Main The domain of $f(x)=\dfrac{1}{\sqrt{[x]-x}}$ is (A) $\mathbb{R}$ (B) $\mathbb{R}-\mathbb{Z}$ (C) $\mathbb{Z}$ (D) $\phi$
E5. JEE Main Numerical value. Let $f(x)=[x]+[-x]$, $x\in\mathbb{R}$. Find the number of elements in the range of $f$.
E6. JEE Advanced One or more options correct. Which of the following relations define a function from $\mathbb{R}$ to $\mathbb{R}$? (A) $\{(x,y) : y=|x|\}$ (B) $\{(x,y) : y^2=x\}$ (C) $\{(x,y) : y=[x]\}$ (D) $\{(x,y) : x=[y]\}$
Research question. Which everyday prices are step functions, and how do their "steps" compare โ are you charged for every started unit or every completed unit?
Why it matters. Parking fees, postage rates, mobile data packs, taxi fares and electricity slabs are piecewise or step functions. Whether a tariff counts completed units ($[x]$) or started units changes what you pay at the edges by a whole step โ a small difference per bill, a large one across a city.
What to do.
- Find two published tariffs (a parking board, a postal rate card, a taxi or auto-rickshaw fare chart, an electricity bill).
- Write each as a function of the measured quantity, using $[x]$ or a piecewise definition; state the domain and range.
- Draw the graph of each and mark the filled and hollow end points of every step.
- Decide whether each tariff charges for completed or started units, and compute the largest possible difference between the two conventions for a typical use.
Tools: Phone camera for the tariff; graph paper or a graphing app
Hand in: The two functions, their graphs, and a paragraph on which convention is fairer to the customer.
Going further. "Every started hour" cannot be written as $[t]$ alone. Show that for $t\gt0$ it equals $-[-t]$, and check your formula at $t=2$ and $t=2.1$.
๐งช Self-check quiz
Q1. $[-1.5]$ equals
Q2. The domain of $f(x)=\dfrac{1}{x-2}$ is
Q3. The range of the signum function is
Q4. Which relation from $\{1,2,3\}$ to $\{a,b\}$ is not a function?
Q5. The range of $f(x)=|x|$, $x\in\mathbb{R}$, is