Let $X$ be a variety (or just a scheme) then for a point $p \in X$ with local ring $\mathcal{O}_{p}$ at $p$, we define the cotangent space at $p$ to be the $\kappa(p)$-vector space $\mathfrak{m}/\mathfrak{m}^{2}$, where $\mathfrak{m}$ is the maximal ideal of $\mathcal{O}_{p}$ and $\kappa(p)$ is the residue field at $p$.
But why? I cannot see the intuition behind this. The vector space $\mathfrak{m}/\mathfrak{m}^{2}$ is just the space of functions vanishing at $p$, modulo higher order terms. So in other words, first order approximations of functions vanishing at $p$.
All of my intuition tells me this is precisely what a tangent space is. So why is this the cotangent space? Why do we not then call the space of derivations the cotangent space?
I was tempted to say this was just a matter of convention, but most algebraic geometry books claim that the cotangent space is more natural, and suggest that this is a quirk of algebraic geometry as opposed to differential geometry. So this suggests it is not just a convention but that there is some real meaningful difference.
I am sorry if this is an extraordinarily basic question, but I find I am just going about using the definition without actually really knowing what or why I am doing it.
Best Answer
Your intuition is not correct: a tangent vector at a point is something you can take a directional derivative along. This leads naturally to the identification of the tangent space with the derivations acting on local functions defined at our point by sending a direction to the derivative along that direction (one can check that this is reversible). In other words, if $X$ is a $C^\infty$ manifold with a point $p\in X$, then $T_pX=\operatorname{Der}(\mathcal{O}_{X,p},\Bbb R)$.
If we do the same thing for a scheme, we get $T_pX=\operatorname{Der}(\mathcal{O}_{X,p},\kappa(p))$, and this is the dual of $\mathfrak{m}/\mathfrak{m}^2$ because a derivation can only see the linear term. Voila, the Zariski cotangent space!