TITLE: In terms of functions why am I allowed to separate $f$ and $g$ from $x$?
QUESTION [7 upvotes]: While studying Linear Algebra I came across a function notation that looked like this: $(f + g)(x)$.
I also saw that this was the same thing as saying $f(x) + g(x)$.
I understand the function notation $f(x)$ and $g(x)$ (which are literally functions) but I do not understand the notation $(f + g)(x)$.
Could anyone please fill me in with some introductory info of what this notation means? My guess is that it is a composite function. However I saw that a composite function does not have a plus but a circle in it so I may be wrong. Also from an algebraic perspective, it sort of looks like you can apply the distributive law on $(f + g)(x)$ to make it into $f(x) + g(x)$. That sounds a bit strange to me because notation wise it doesn't make sense. 
I have heard that this means $(f + g)$ "evaluated at $x$", which I don't understand.
I would greatly appreciate it if someone gave an overview of the $(f + g)(x)$ notation. Thank you in advance everyone.

REPLY [2 votes]: To expand on the explanation by Eric Wofsey:
Assume we have any two functions $f:X\to Y$ and $g:X\to Y$ (if you are not familiar with that notation, it just means in $f(x)$ resp. $g(x)$ we can use for $x$ any value from the set $X$, and the corresponding function value will always be found in the set $Y$). Further assume we can add those values found in $Y$ (for example, $Y$ contains real numbers). Then no matter what $f$ and $g$ are, we can define a function $h$ by $h(x) = f(x)+g(x)$.
So for example, take the function $\sin x$ and the function $\cos x$. Then we have a function $h(x) = \sin x + \cos x$.
Or take the functions $\ln x$ and $\tan x$. Then we have a function $h_2(x) = \ln x + \tan x$.
Observe that the resulting function depends only on the two functions which we started with. But for such a relation where you can put something in, and then get something else which only depends on what we have put in, we have a name: It's a function! So what we have defined here is, indeed a function, but one that doesn't operate on numbers or vectors, but on other functions.
Let's for the moment call that function $S$. So $S$ takes two functions, say $f$ and $g$, and gives another function, let's call it $h$, which for any given $x$ gives the sum of the values of $f(x)$ and $g(x)$. So we have
$$h = S(f,g)$$
OK, this is straightforward, isn't it? But wait, as $h$ is a function, we can apply it; such an application is written $h(x)$. Now insert the $h$ from above, and you get:
$$h(x) = S(f,g)(x).$$
Of course, the way we defined $S$, we just have $h(x) = f(x) + g(x)$. Therefore,
$$S(f,g)(x) = f(x) + g(x).$$
What is left is just a notational convenience: The fundamental operation $S$ is defined on is the operation of adding two values. Now remember that when we write $a+b$ for two numbers, all we do is to apply a two-argument function $s$ to $a$ and $b$. But instead of writing $s(a,b)$ and explaining in detail what $s$ is, we just introduce an operator notation and write $s(a,b) = a+b$.
Now our function $S$ essentially is nothing but an addition: We add two function values in order to obtain the result. Therefore just as with numbers, we define the operator notation
$$f + g := S(f,g).$$
And if we use this notation in the previous displayed equation, we get exactly
$$(f+g)(x) = f(x) + g(x).$$
However there's more to it, especially in linear algebra: As it turns out, if $f$ and $g$ are linear functions, then $f+g$, as defined above, is also a linear function. Moreover, with this definition (and a similar definition for scalar multiplication), the linear functions turn out to be a vector space in their own right, and in  this vector space, the operation $f+g$ acts exactly how the addition of vectors should act, therefore giving an additional justification of that notation.
Finally, if you look very closely, you'll find that the standard vector addition in $\mathbb R^n$ itself is nothing than such a function addition: When you write $a_k$ for the $k$-th component of the vector $a$, what you are really doing is to apply a function from a set $I$ of indices (usually $I=\{1,2,\ldots,n\}$) to the set of real numbers. That is, you can interpret your vector $a\in\mathbb R^n$ as a function that maps indices to real numbers. It's just that instead of writing the function application as $a(k)$, you write it as $a_k$. But there's really not the slightest difference apart from notation: You put an index in, you get a number out. And the vector describes which number you get for each index.
Now how do you add vectors in $\mathbb R^n$? Well,
$$(a+b)_i = a_i + b_i.$$
Now let's rewrite the index notation into standard function application notation:
$$(a+b)(i) = a(i) + b(i).$$
And voila, there's the function addition formula again.