Why were affine spaces defined so? My geometry textbook gives this definition of affine space:
A set $A$ is called "affine space" iff, given a $K$-vector space $V$, there exist a function $f$ from $A \times A$ to $ V $ such that the following conditions are satisfied:
1)for every $P \in A $ and $v \in V $ there exist one and only one $Q \in A $ such that $f((P,Q))=v$
2)for every $P, Q, R \in A $, $f((P,Q))+f((Q,R))=f((P,R))$
What I could understand is that we are making a generalization of ordinary space. With this definition, the geometrical space built upon Hilbert axioms becomes a special case of affine space, because 1) and 2) hold. My question is: why were those two properties chosen to make such a generalization?
Moreover, why was it necessary? why using linear algebra instead of the axiomatic or analytic (as in high school) approach?
 A: First, this is not the standard definition of an affine space, which is a set $A$, a fixed vector space $V$, and a function $f:A\times A\to V$ satisfying certain axioms.  Your definition cannot be satisfied with a set $A$ that has more than one element.
The point of this definition is to avoid specifying an origin.  Think about it: whenever you're dealing with $\mathbb{R}^n$, or any vector space over a field, there is a single point, $\vec{0}$, with special properties.  But we often want to describe things—say, a physical plane—in such a way that no point is special, or so that we can choose an origin later, to be whatever we choose.
Our function $f$ is like a subtraction—the points of $A$, which are like points in space, are not vectors, but the difference between any two of them is.
Axiom 2 makes it clear that $f$ behaves like subtraction, since $(\vec{p}-\vec{q}) + (\vec{q}-\vec{r}) = \vec{p}-\vec{r}$.  Axiom 1 is making sure that we can undo this subtraction; for every $\vec{p}$ and $\vec{v}$, there is a unique $\vec{q}$ with $\vec{p}-\vec{q}=\vec{v}$.
This gives us exactly what we want: something that turns into a vector space as soon as we choose an origin (if $O$ is the origin we want, then $P\mapsto f(P,O)$ gives a bijection $A\to V$ that identifies $O$ with $0\in V$).
