In mathematics a $f$ function acts sort of like a machine where one puts a value in as an argument $f(z)$ and it returns some other value.
The definition of a function tells us what it does. $(X,Y,G)$ In this definition the set $X$ is called the domain and indicates what inputs the function can take.
$Y$ is called the codomain and indicates what outputs the function may return.
$G$ tells us what the function does. It is a set of pairs $(x,y)$ where $x$ is an element of $X$ and $y$ is an element of Y. When an argument $z$ is inputted into the function the function will find the $(x,y)$ pair where $x = z$ and return the $y$ element from that pair.
In order for $G$ to work correctly there needs to an $(x,y)$ pair for every element in $X$ and there can't be two pairs with the same $x$ value because then the function doesn't know which one to use.
A very simple example of a function would be if you had the the following sets.
$$X = \{0,1\}$$
$$Y = \{2,3\}$$
$$G = \{(0,2),(1,3)\}$$
$$f = (X,Y,G) $$
In this $f(0) = 2$ and $f(1) = 3$. The definition of functional is a set that has the properties stable for being used like this. A set of pairs with a unique domain member of the pair for each element of the domain.