A function whose co-domain is R (or a subset of R) is a real-valued function. When f,g share the same domain X, we can combine their output values using ordinary real-number arithmetic, defining new functions on X:
(f+g)(x)=f(x)+g(x),(f−g)(x)=f(x)−g(x),(fg)(x)=f(x)g(x),
(gf)(x)=g(x)f(x) (g(x)=0),(cf)(x)=cf(x) (c∈R),(−f)(x)=−f(x).
The domain need not be a set of numbers at all -- e.g. if X is a class of students and f,g are their marks in two different tests, f+g is exactly their combined (total) marks function.
Properties (mirroring the field properties of R itself): (f+g)+h=f+(g+h); f+g=g+f; 0+f=f+0=f (zero function as identity); f+(−f)=(−f)+f=0; f(g+h)=fg+fh (distributivity); (c1+c2)f=c1f+c2f.
Proof of distributivity (representative proof). To show f(g+h)=fg+fh, check both sides agree at every x in the common domain:
(f(g+h))(x)=f(x)(g+h)(x)=f(x)[g(x)+h(x)]=f(x)g(x)+f(x)h(x)=(fg)(x)+(fh)(x)=(fg+fh)(x), …