What is the relation between the high school definition of a vector and the abstract algebra definition? I'm studying linear algebra, and I've been getting to grips with the idea of groups and fields and vector spaces. From what I understand, to be a vector is just to be an element of a vector space, and all sorts of unusual (to the beginner) things turn out to be vector spaces. For example, the set of all real-valued functions is a vector space over $\mathbb{R}$. I take it this means that all real-valued functions (e.g. $\sin x$) are vectors over $\mathbb{R}$. But how does this abstract definition fit with the earlier account we are given of vectors as quantities with magnitude and direction or directed line segments?
 A: The "high school" vectors belong to finite-dimensional vector spaces, namely $\Bbb R^2$ and $\Bbb R^3$. The abstract definition of a vector space expresses some of the essential properties of addition and scaling in these spaces that make them behave according to our spatial intuition.
The fact that many things satisfy the requirements of the abstract definition (like $\Bbb R^5$, or sets of functions with suitably defined operations) means that some of our intuition about arrows, lines, planes, projections, distances, etc. are applicable to these spaces, even though the mental picture is a little less concrete (and e.g. things can happen in infinite-dimensional spaces that can't happen in finite-dimensional ones). Carefully studying the logical consequences of the abstract definition tells us how exactly we can extend the intuition in different applications.
By the way, I think your statement that "$\sin x$ is a vector over $\Bbb R$" reflects a slight misunderstanding. You should really say "there exists a vector space over $\Bbb R$ that includes the $\sin$ function as an element". That is, $\sin$ isn't a vector by itself - you need the whole space (with its specific addition and scaling operations) in order for "being a vector" to mean anything.
A: What you deal with in HS is not just a vector space but an inner product space.
What is that? Well it's a vector space with an additional structure of a dot product.
Why do I say only dot product? What about lengths and distances? Well the inner product is most fundamental. It implies all of the below structures. We define the length of vectors as:
$$ N(a) = \sqrt{ \langle a, a \rangle }$$
And, the distance between two vectors induce through the norm as:
$$ d(a,b) = || a-b ||$$
That is the norm of the difference vector.
An interesting question to ask is, in the abstract sense, when is it that a norm can be derived from an inner product? Well that's exactly when the parellogram law holds.
So, it's just an issue of HS abusing the mathematical naming a lot. Hope it is clear now.
In essence, what I want to say is, the HS idea of a vector space is actually much beyond the mathematical vector space. On a vector space level itself, even functions can take part.

Bonus!
You can make functions also into inner product space.  You can think about integration over an interval as an inner product:
$$  \langle f,g \rangle = \int_a^b f g dx$$
You can check that the inner product is commutative (Switch slot of f,g) , linear in each slot etc just like normal dot product. You can also show the Cauchy Schwarz Inequality:
$$ \int_a^b fg dx \leq \sqrt{\int_a^b f^2 dx } \sqrt{\int_a^b g^2 dx}$$
Of course, there is a whole lot of "fine print" that I am skipping out, but this is more or less the idea.
Also it is not that in a given vector space there is only one inner product we can put, there are probably many ways to define one.
A: Recall the defintion for a vector space $V$:
Given a field $K$ and a set $V$ with the folowing operations:
$$+ :V \times V \rightarrow V, \quad (v,w) \mapsto v+w $$
$$\cdot :K \times V \rightarrow V, \quad (\lambda,w) \mapsto \lambda \cdot v  $$
Then $V$ is said to be a vector space if

$A_1$ : $(V,+)$ is a commutative group regarding the operation $+$.


$A_2$: The $\cdot$ operation must hold the following

$$(\lambda + \mu ) \cdot v = \lambda \cdot v + \mu \cdot v, \quad \lambda  \cdot ( v + w ) = \lambda \cdot v + \lambda \cdot w $$
$$\lambda \cdot (\mu \cdot v) = (\lambda \cdot \mu) \cdot v, \quad 1 \cdot v = v,$$
For all $\lambda, \mu  \in K$ and $v,w \in V$.
So basically this abstract definition gives a set $V$, that has the least amount of structure one would need to do basic linear algebra, what ever that means.
Now if you look at  the set $\mathbb{R}^n$ in highschool (mostlikely the case $n=3$ or $n=2$) which is a vector space, you are dealing with "vectors" such  as $\overrightarrow{a} = (1,2,3)^T$, where one would define vector addition and scalar multiplication column wise. This set comes naturally with a lot more structure than $V$. For example the inner-product $\langle \ , \ \rangle : \mathbb{R}^n \times \mathbb{R}^n \rightarrow K$ in $\mathbb{R}^n$ or the euclidian distance a.k.a  euclidian norm given by
$$\mid \overrightarrow{a}-\overrightarrow{b} \mid= \sqrt{(a_1- b_1)^2 + ... + (a_n - b_n)^2}$$.
Generally $V$ does not come with such structure's, but some do and they get different names such as normed vector spaces (if they have a norm see norm axioms) and inner product spaces if they have a inner product.
The motivation for this abstraction lies in that you able to state theorems for all vector spaces with certain property's or structures. Once one proved a theorem for certain vector spaces it becomes applicable for all vector spaces with the same properties. Now regardless how exotic you concerning vector space may be, the rules and theorem apply, and you are able to play with them as if they were element's in $\mathbb{R}^n $ (if they are same dimension etc.) and thats the beauty of it!
Now not all vector spaces have a visual interpretation like $\mathbb{R}^3$, but the same rules, for example the vector space of real valued continuous and  bounded functions does not have a geometric interpretation to it (at-least not that I know off) but you are able to define a norm on it and even a inner-product! see Banach spaces or Hilbert spaces.
A: During one's original study of vectors, while thinking of them as "quantities with magnitude and direction" or as "directed line segments",  one slowly learns various properties of vectors involving the operations of arithmetic.
For example, one learns that two vectors in the same vector space (i.e. in $2$-dimensional space $\mathbb R^2$ or in $3$-dimensional space $\mathbb R^3$) can be added to produce another vector, using the parallelogram law of addition. Abstracting this slightly one simply says

Addition is a binary operator on vectors.

One also learns that it doesn't matter what order you add the two vectors in, the result of that operation will turn out the same. Abstractly,

Vector addition is commutative.

Just like with numbers, if you want to add three or more vectors, you have to do it two-at-a-time by inserting parentheses to group terms, but it doesn't matter how you insert those parentheses:

Vector addition is associative.

One next learns that there is actually an exception to the rule that a vector is a "directed line segment" or a "quantity with magnitude and direction", because there is a very special vector $\vec O$ which has no magnitude and points nowhere. You can still add this vector to other vectors, but the outcome is special: $\vec O + \vec V = \vec V$ no matter what $\vec V$ is.

There is an identity element of vector addition.

Now, I could go on in this vein, continuing with a slow explanation of how scalar multiplication works, and then writing down the abstract laws of scalar multiplication. But perhaps you have seen the pattern: the abstract laws that I am writing down are building up to be the abstract definition of a vector space. The above four laws are already about half of the definition of a vector space; I'm sure you can carry out the rest of this process with scalar multiplication.
Abstraction is a central process in the human development of mathematics. We look at familiar objects (e.g. vectors), we study their properties, if we're clever enough we abstract those properties, and then we notice: Hey! There are many other settings where those properties hold! I think I'll call those settings vector spaces!
