How can vectors depend on position? When I first learned about euclidean spaces and affine geometry, I was told that a cartesian coordinate system in $\mathbb{R}^n$ is a pair ($O,\mathcal{B}$) where $O$ is the origin, a point in $\mathbb{R}^n$ as an affine space, and $\mathcal{B}$ is a basis of $\mathbb{R}^n$ as an $\mathbb{R}$-vector space.
Later, though, I was introduced to curvilinear coordinate systems, which are kind of the same but with basis vectors that change depending on their position. That seems to contradict the idea that I had of vectors in $\mathbb{R}^n$, which was that they can be geometrically interpreted as arrows attatched only to the origin.
How is the idea of vectors depending on position formalised, then?
 A: The formalisms of affine geometry are quite different from the ones used in the study of general manifolds. There is no need to consider vectors in every point of space when studying affine geometry because a single basis is enough to cover all space, but when studying differential geometry and physics it becomes necessary to consider "local" coordinates, and thus local vector basis.
So, in $\mathbb{R}^n$ or any other topological space, we can define a  $\mathbb{R}$-vector space "attatched" to every point $p \in \mathbb{R}^n$. We call that space a tangent space, and we denote it $T_p\mathbb{R}^n$.
Its elements are pairs of the form $(p,v)$, with $v \in \mathbb{R}^n$ interpreted as a $\mathbb{R}$-vector space; and they can be geometrically interpreted as arrows with its origin on $p$.
In fact, we can define a tangent space to every point of any differentiable manifold $\mathcal{V}$, so that the points $p+v$ with $(p,v)\in T_p\mathcal{V}$ form the linear manifold tangent to $\mathcal{V}$ at $p$. That's why it's called a tangent space.
The disjoint union of all the sets $T_p\mathcal{V}$ with $p\in\mathcal{V}$ is called the tangent bundle of $\mathcal{V}$, $T\mathcal{V}$.
Now that we have defined all this, a vector which changes depending on its position is just a vector field, a function $v\space\colon\space \mathbb{R}^n\longrightarrow T\mathbb{R}^n$ which maps a point $p$ of the topological space $\mathbb{R}^n$ to a vector $(p,w) \in T_p\mathbb{R}^n$
