Let $V$ be a finite-dimensional vector space with basis $e_1, ... e_n$. Then we may write any vector $v$ in the form
$$v = \sum c_i e_i$$
for some coefficients $c_i$. Sending a vector $v$ to the coefficient $c_i$ for fixed $i$ defines a linear functional $e_i^{\ast} : V \to k$. These linear functionals together constitute the dual basis to $V$, and what confused me for a long time is that linear functionals do not transform in the same way as vectors under change of coordinates; we say that vectors transform covariantly but linear functionals transform contravariantly. Before I understood this I was constantly getting confused about the difference between transforming a vector and transforming its components.
For an infinite-dimensional example, consider the vector space $k[x]$ of polynomials in one variable over a field. It has a distinguished set of dual vectors given by the functions $[x^n]$ which return the coefficient of $x^n$ in a polynomial. To be suggestive you can write these functions as $\frac{1}{n!} \frac{d^n}{dx^n}_{x = 0}$. It turns out that the dual space $k[x]^{\ast}$ is precisely the product of the spaces containing each of these dual vectors; for example, the dual space contains vectors that ought to be called
$$(e^{t \frac{d}{dx} })_{x=0} = \sum_{n \ge 0} \frac{t^n}{n!} \frac{d^n}{dx^n}_{x=0}$$
that given a polynomial $f(x)$ return the numerical value of $f(t)$.
Thinking of $\frac{d^0}{dx^0}_{x=0}$ as a toy model for the Dirac delta function, you can think of this construction as a toy model for (Schwartz) distributions.
In differential geometry, the dual of a tangent space $T_p(M)$ at a point $p$ on a manifold $M$ is the cotangent space $T_p^{\ast}(M)$ at $p$. Just as the tangent space captures the infinitesimal behavior of smooth functions $\mathbb{R} \to M$ near $p$ (curves), the cotangent space captures the infinitesimal behavior of smooth functions $M \to \mathbb{R}$ near $p$ (coordinates). Just as a nice family of tangent vectors gives a vector field, a nice family of cotangent vectors gives a 1-form. In classical mechanics, the cotangent bundle is the phase space of a classical particle traveling on $M$; cotangent vectors give momenta.
For me duality really shines when you combine it with tensor products and start using the language of tensors. Then you can describe any kind of linear-ish thing using a combination of tensor products and duals, at least for finite-dimensional vector spaces:
- What's a linear function $V \to W$? It's an element of $V^{\ast} \otimes W$.
- What's a bilinear form $V \times V \to k$? It's an element of $V^{\ast} \otimes V^{\ast}$.
- What's a multiplication $V \times V \to V$? It's an element of $V^{\ast} \otimes V^{\ast} \otimes V$.
When you have a bunch of linear-ish things around, writing them as all tensors helps you keep track of exactly how you can combine them (using tensor contraction). For example, an endomorphism $V \to V$ is an element of $V^{\ast} \otimes V$, but I have a distinguished dual pairing
$$V^{\ast} \otimes V \to k.$$
What does this do to endomorphisms? It's just the trace!
There's an obvious functor $\text{Mat} \to \text{FinVect}$ which is an equivalence, but no obvious choice of inverse to this functor; choosing an inverse amounts to choosing, for each finite-dimensional vector space (note that there is more than a set's worth of such things!), a basis of that vector space. Not a fun operation to perform; we need something like the axiom of global choice to do it.
What can be done without making such choices is the following: there is an intermediate category which I'll just call $\text{Base}$, the category of finite-dimensional vector spaces together with a choice of basis (morphisms are still just linear transformations). There is an obvious functor $F : \text{Base} \to \text{FinVect}$ given by forgetting the basis, and an obvious functor $M : \text{Base} \to \text{Mat}$ given by writing linear transformations with respect to a basis. Both of these functors are equivalences, but again the functor $F : \text{Base} \to \text{FinVect}$ can't really be inverted obviously. See also anafunctor.
$\text{Base}$ has a dualization endofunctor $D : \text{Base} \to \text{Base}$ which takes duals of linear transformations and sends a pair $(V, B)$ of a vector space and a basis to the pair $(V^{\ast}, B^{\ast})$ of the dual vector space and the dual basis. Now what we can say is that the functors $F$ and $M$ intertwine this dualization functor and the other dualization functors, in the sense that we have not just natural isomorphisms but equalities
$$F \circ D = (-)^{\ast} \circ F : \text{Base} \to \text{FinVect}$$
$$M \circ D = (-)^T \circ M : \text{Base} \to \text{Mat}.$$
Best Answer
The functor $F$ is a contravariant functor, that is why it reverses composition. Check out the definitions at
http://en.wikipedia.org/wiki/Functor