What is the difference between a functional and a composite function? 
Definition: A  quantity $z$ is called a functional of $f(x)$ in the interval $[a,b]$ if it depends on all the values of $f(x)$ in $[a, b]$.

So the first order of business is this: 
Is a functional a function? 
And which direction does it go? 
Do you start with a variable and evaluate it at the functional level and then use that as input to the function or the other way around?  
Evaluate the function at some value and then place that in the functional's output.  
Or is it not a function at all?
 A: A functional takes a function and gives you a number. 
For example the functional $$ \int _a ^b f(x) dx $$ takes $f(x)=x^2$ and turns it into $\frac {b^3-a^3}{3}.$
Another functional is $z=f''(0)$ which takes $f(x)=3x^2+1$ and turns it into $6$
As you see a functional is not a composite function, but  it is an operator whose domain is a vector space of functions and its range is the field of that vector space.    
A: 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.
A: It is true that the historical origins of the notion of "functional" were as a thing that would receive input of a function (in some vector space of functions) and produce an output that was a scalar.
This was abstracted more than 100 years ago to the following idea, which is now standard: for a vector space $V$ over a field $k$, a $k$-linear map $V\to k$ is called a ($k$-linear) functional on $V$. When $k$ has a topology and $V$ is a topological vector space over $k$, we may (or may not) require that a functional be continuous.
Yes, as in other answers and comments, very often interesting and useful functional are expressed in terms of integrals... which is the historical origin and indication of the usefulness of the abstracted idea.
