how can a set of functions form a vector space?
Take two functions which are in that particular form. Their "sum" (there is an obvious way to define sum of functions) is again in that same form. It forms an abelian group for this sum.
Also for any real number $k$ one can define $k$ times such function: it will gain be of the same form.
This sum defined on this set of functions satisfy all the properties that your "standard vector spaces on real numbers" satisfies. For example $f(x) = c_1+ c_2\sin^2 x + c_3\cos^2 x$, $g(x) = c_1' +c_2'\sin^2x+c_3'\cos^2x$, then $k(f(x)+ g(x)) = kf(x) + kg(x)$. Look at all the axioms of abstract vector spaces. All hold here. The scalars are still real numbers (or equally well complex numbers)
A set of functions form a vector space if they obey the general definition of vector space.
To see that any set of vectors form a vector space, you can just check if the set has the following properties.
http://mathworld.wolfram.com/VectorSpace.html
As for the basis part of the question, you need to know something about linear independence. A basis is essentially the smallest linearly independent set that can span the set as a whole, i.e. there is some linear combination of this potential basis for each vector in the larger set.
The dimension is the cardinality of the set of basis vectors.