In physics class, students are often shown vectors in $\mathbb{R}^n$ (for $n=2$ or $n=3$ of course) via arrow diagrams and they are told that a vector is an entity with magnitude and direction.
But then in abstract linear algebra, we learn that yes, $\mathbb{R}^n$ is one example of a vector space but there are others like $C^\infty$ functions for example. However, if $C^\infty$ functions are to have magnitude and direction, we must have a norm and an inner product defined on the space as well. It doesn't come automatically with one.
Therefore, we have two definitions of vector:
(1) An entity with magnitude and direction (2) An entity which satisfies the vector space axioms
These are very different because a vector space can't be assumed as endowed with something that gives its members magnitude and direction. Doesn't this mean the physics lessons are technically giving a wrong definition?
The first definition is closer to elementary geometry and is more intuitive, but the intuition seems to be limited to "simple" vector spaces like $\mathbb R^2$ and $\mathbb R^3$. However, it is not that far from (2) than one might believe.
Let us first think about the concept of direction. What is a direction in the plane $\mathbb R^2$? This seems to be very clear, but if you want to a make it precise you will see that it is by no means trivial.
Let us agree that, in a naive sense, a vector $v$ in $\mathbb R^2$ is an arrow starting at $(0,0)$ and ending at $(x,y)$. [In physics sometimes a vector is also regarded as an arrow connecting any two points in the plane - this leads to the concept of an affine space which we shall not discuss here.] Since the starting point $(0,0)$ is fixed, a vector is uniquely determined by its end point and we can simply write $v = (x,y)$.
How do we know that that the vectors $v_1= (1,0)$ and $v_2 = (2,0)$ have the same direction and $w_1= (0,-1)$ and $w_2 = (1,3)$ do not? The answer is that $v_2$ is a positive multiple of $v_1$, but $w_2$ is not a multiple of $w_1$. Thus a formal definition of direction which works is any vector space is this:
Note that $u_1= (1,0)$ and $u_2 = (-1,0)$ do not have the same direction because $u_2$ is a negative multiple of $u_1$. In fact, they have the opposite direction. We can also assign to $0 \in V$ a direction (the "zero direction"), but it is a philosophical question whether it makes sense to regard this as a "real" direction.
Let us next think about the concept of magnitude. In $\mathbb R^2$ (and also in $\mathbb R^3$) the meaning is clear, but it requires an additional structural component beyond addition and scalar multiplication. This component is the standard Euclidean norm given by $\lVert (x,y) \rVert = \sqrt{x^2+y^2}$. It associates to each vector a magnitude (or length) and thereby allows to compare the magnitude of non-collinear vectors $v_1, v_2$. Note that if $v_1,v_2$ are collinear, i.e. lie on a single line through the origin, the $v_1,v_2$ have the same magnitude if and only if $v_2 = \pm v_1$.
We conclude that speaking both about direction and magnitude is only possible in normed vector spaces. This is an adequate setting for physics, and there is nothing wrong about it. In a normed vector space $(V,\lVert - \rVert)$ there is a $1$-$1$-correspondence between vectors $v \ne 0$ and pairs $(d,l)$ where $d$ is a direction and $l > 0$. Precisely in that sense (1) and (2) are equivalent. The issue with (1) is that is not completely transparent how the addition of vectors in the form $(d_1,l_1)$ and $(d_2,l_2)$ is working.