Functions

A function $f$ from a set $X$ to a set $Y$ is an assignment (denoted as $f:X \rightarrow Y$) that assigns to each element $x \in X$ exactly one element $y \in Y$ (denoted by $f(x)$). Here, $X$ is called domain of $f$ and $Y$ is called the codomain of $f$. The range of $f$ is $\{y \in Y: \exists x \in X, f(x)=y\}$. Following are examples of functions.
  1. $f:\{1,2,3\}\rightarrow \{a,b,c\}$ with $f(1)=c$, $f(2)=a$, $f(3)=a$
  2. $g:\mathbb{N} \rightarrow \mathbb{N}$ with $g(n)=n+1$ for each $n \in \mathbb{N}$
  3. $h:\mathbb{R} \rightarrow \mathbb{R}$ with $h(x)=x^2$ for each $x \in \mathbb{R}$
In this session, we will only study functions with $\mathbb{R}$ as domain and codomain. Such a function is called a real-valued function of a real variable or a real function. These functions have a nice graphical representation. The graph of a function $f:\mathbb{R} \rightarrow \mathbb{R}$ is the set of points $\{(x,f(x)) : x \in \mathbb{R}\}$ in the 2-dimensional plane.

$f(x)=x^2

Examples of Real Functions

Lines Mod
Cube Square

Composition of Functions

For functions $f:\mathbb{R}\rightarrow \mathbb{R}$ and $g:\mathbb{R}\rightarrow \mathbb{R}$, define a new function $g \circ f:\mathbb{R} \rightarrow \mathbb{R}$ as $(g \circ f)(x)=g(f(x))$. View $(g \circ f)(x)$ as the function $g$ applied after applying $f$ to $x$. Sophisticated functions can be built from simpler functions using compositions.

To learn more, check out the Slides and the Worksheet for this session!