Vector space of a Function (Example for understanding the concept) In my textbook is stated: 
Let G be a finite-dimensional vector space of real functions in $R^D$.
What is meant by "vector space of real functions"? 
I know what a vector space is, by I don't get how can real functions form vector space (The only vector spaces that I might see regarding a function are the vector space of the domain and codomain)
Please, if you are aware, provide me a tangible and intuitive example with the explanation, as I find examples extremely useful for understanding.
 A: You should not try to "visualize" a single vector as whatever by all means, tried this ever for a five-dimensional one?  We can't "visualise" such high-dimensional vectors, but we want to talk of concepts of parallelism or planes or projections (in such vector spaces).  You can't "visualise" the vector $(1,2,3,4,5)$, but you may say that it's parallel to $(2,4,6,8,10)$ and that it's projection on the (not  visualisable) plane spanned by $(1,0,0,0,0)$ and $(0,1,0,0,0)$ is $(1,2,0,0,0)$.  And that transfer can be done with sets of functions.
Take, for example, $\mathbb R^J$ (where $J$ is a non-empty set), the set of real-valued functions defined on  $J$. We want consider each member, that is: each function, of $\mathbb R^J$ as a single vector.  
First we recall that two functions $f$ and $g$, defined on the same domain, are defined equal, iff they are pointwise equal, that is, $f=g$ iff for all $x$ from the common domain we have $f(x)=g(x)$. 
From here we may define the sum of two functions $f$ and $g$, which is a function of its own, pointwise:
Define for $f,g\in \mathbb R^J$ their sum $f+g$ by $(f+g)(x):=f(x)+g(x)$ for all $x\in J$.  Furthermore we may define for any real number $c$ the new function $c\cdot f$ by $(c\cdot f)(x):=c\cdot f(x)$. 
It's easy to verify that now $\mathbb R^J$ is a real vector space.  (It may be  infinite-dimensional, but that doesn't matter in this case.) For example, one has to verify that 
$$c\cdot (f+g)=c\cdot f+c\cdot g.$$
But that's nearly trivial since by the above definitions 
$$\begin{align}\bigl({\bf c\cdot(f+g)}\bigr)(x)&=c\cdot\bigl((f+g)(x)\bigr)\\
&=c\cdot\bigl(f(x)+g(x)\bigr)\\
&=c\cdot f(x)+c\cdot g(x)\\
&=(c\cdot f)(x)+(c\cdot g)(x)\\
&=({\bf c\cdot f+c\cdot g})(x).\end{align}
$$
To give an example, recall that for any non-zero vector $f$ of a vector space $V$ the set $g=\{c\cdot f|c\in \mathbb R\}$ is a straight line through the origin.  Now let $J=\mathbb R$, hence $V=\mathbb R^{\mathbb R}$ and let $f$ be a well known function defined by $f(t)=t^2$.
From this point of view the set $g=\{c\cdot f|c\in \mathbb R\}$ is a straight line in $V$ through the origin. Any point $p$ of $g$ is a function $p$ which is defined by $p(t)=c\cdot t^2$.
By the way, the "usual" vector space $\mathbb R^n=\mathbb R^{\{1,\dots,n\}}$ is nothing else as the set of functions $\vec v\colon\{1,\dots,n\}\to\mathbb R$, can you see this?  Such a $\vec v$ is determined by the values it takes for $1,\dots,n$, that is by $\vec v(1).\dots,\vec v(n)$; commonly one writes $v_k$ instead of $\vec v(k)$ for $1\leq k\leq n$.  And the notation
$$\vec v=\begin{pmatrix}v_1\\
\vdots\\
v_n\end{pmatrix}$$
is nothing else but an abbreviate form of the table of values that $\vec v$ takes on $\{1,\dots, n\}$.
Now take another function $\vec w$ from $\mathbb R^n$.  From the above definitions we may compute $\vec v+\vec w$, namely by $(\vec v+\vec w)(k)=\vec v(k)+\vec w(k)$.  Now this boils down, abbreviated, to
$$\vec v+\vec w=\begin{pmatrix}v_1+w_1\\
\vdots\\
v_n+w_n\end{pmatrix}.$$
A: $\mathbb R^D$ is the set of all functions $f:D \to \mathbb R.$ If we define an addition $f+g$ and a scalar multiplication $ \alpha f$ in this set by
$(f+g)(x)=f(x)+g(x)$ and $( \alpha f)(x)= \alpha f(x)$,
then $\mathbb R^D$ is a real vector space ( of functions).
A: Take a collection of functions and see if you can demonstrate all the properties of a vector space using them.
A vector space requires:


*

*An additive identity (written $0$ in ${\mathbb R}$).  The function $f\equiv 0$ fulfills this need.

*A scalar multiplicative identity (written $1$ in ${\mathbb R}$).  $1$ works here since $1\cdot f = f$

*Commutativity of addition: $f+g = g+f$

*Associativity of addition: $f+(g+h) = (f+g)+h$

*Associativity of scalar multiplication: $\alpha (\beta f) = (\alpha \beta)f$

*Distributivity of scalars: $(\alpha + \beta)f = \alpha f + \beta f$

*Distributivity of scalars over vector addition: $\alpha(f+g) = \alpha f + \alpha g$

*An additive inverse: given $f$ there exists $g$ such that $f+g = 0$.  Obviously $g=-f$ satisfies this.

A: I'll offer a point of view that gives some concrete examples.
As people have mentioned, the only thing necessary to have a "vector space" is the ability to add objects together, and multiply them by scalars (subject to some special rules).  We have this for functions that share a common domain and codomain.   If we consider all functions with codomain $\mathbb{R}$, and fixed codomain $D$, we get an infinite-dimensional vector space (unless $D$ is a finite set). This is what is usually called $\mathbb{R}^{D}$. 
Now, if we want a finite dimensional vector space, what we are looking for is a subspace of $\mathbb{R}^{D}$ that can be spanned by a finite set of functions. Here span is the normal linear algebra concept, where we are allowed to take linear combinations of the functions, e.g. the span of functions $f(x)$ and $g(x)$ would look like $\{ af(x) + bg(x) \ : \ a,b \in \mathbb{R}\}$.
Some examples: 


*

*If we take the set of constant functions $f(x) = c$ for $c \in \mathbb{R}$, this is a 1-dimensional vector space of functions, because any such function is just $c$ times the function $f(x) = 1$.

*If we take the set of polynomials of degree less than $n$, we get a vector space of dimensions $n+1$, for example the polynomials with degree less than 4 gives a 5-dimensional vector space with basis $\{1,x,x^{2}, x^{3}, x^{4}\}$.

*If we take linear combinations of $\sin{x}$ and $\cos{x}$, we get a vector space of dimension 2 containing functions of the form $\{a\sin{x}+b\cos{x} \ : \ a,b \in \mathbb{R}\}$ (it can be shown that $\sin{x}$ and $\cos{x}$ are not scalar multiples of each other, so are linearly independent).
A: The notion of a vector space is abstract and it can be applied to Functions (sometimes these spaces are called Function Spaces) and these spaces are the subject of Functional Analysis. 
It is important to get away from the geometric representation of a vector space - they are special cases and impossible to think about when we move into higher dimensional spaces. Instead, consider our definition of a vector space:
Let $V$ be a set which is closed under vector addition and multiplication of vectors by scalars, then we call V a vector space. i.e.
$$ \forall x, y \in V \quad \forall c,d \in R $$
$$ cx+dy \in V $$
When we are talking about function spaces we are talking about mappings from a set $X$ to a vector space (over a field but don't get too bugged down in this if you don't know what this means) $V$ (note that $X$ can also be a vector space, then we can consider the function space to be a linear mapping). 
A more simple way of thinking about them is considering them as a collection of functions that share characteristics of their range and whose codomains' are commonly the same.
Example time! 
The function space $C(\mathbb R^n)$ represents all functions who are continuous in $\mathbb R^n$. e.g. $f(x)=x \in C(\mathbb R^1 )$
A Hilbert Spaces are subspaces of $C(\mathbb R^n)$ and often referred to as generalisations of Euclidean space.
