Composition of functions is when you "feed" the result of one function into another function to produce yet a third function. For example, if $f(x) = x^2$ and $g(x) = e^x$ then the composition $g\circ f$ would be defined by $(g\circ f)(x) = g(f(x)) = g(x^2) = e^{x^2}$. As you can see, the result is a function of $x$.
A functional, on the other hand, is when you "feed" a function -- a whole function, not just the value of the function at a specific point -- into some kind of "machine" that assigns a single numerical value to it.
For example, here are some examples of functionals:
- $F(f) = \int_0^6 f(x) dx$. For $f(x) = x^2$, we'd have that $F(f) = 72$.
- $G(f) = \max\{f(x) | -5 \le x \le 3 \}$. For $f(x) = x^2$, we'd have that $G(f) = 25$.
- $H(f) = \textrm{the number of critical points of }f(x) \textrm{ on }[-5, 3]$. For $f(x) = x^2$, we'd have $H(f) = 1$.
Notice that when you apply a functional to a function, the result is a single number. That's what is meant by the statement that the value of $F(f)$ depends, in some sense, on the "entirety" of $f(x)$ in a particular domain.
Notice also that in each of these examples the definition of the functional requires some choice of interval; different choices would lead to different results. Finally, a particular functional may only be defined for certain classes of functions; for example, neither of the examples $F$ and $G$ above are well-defined for a discontinuous function with a vertical asymptote at $x=2$. So in defining a function, one usually needs to limit one's attention to some category of "nice" or "good" functions on which the functional will operate.