What is the motivation for quaternions? I know imaginary numbers solve $x^2 +1=0$, but what is the motivation for quaternions?

With the complex numbers in hand, it's natural to wonder what other systems of numbers containing the real numbers one might have. Before constructing the quaternions, Hamilton tried in vain to construct a $3$-dimensional system; it turns out that this is impossible, and you can see a reproduction of Hamilton's own proof in this recent question: Why should I consider the components $j^2$ and $k^2$ to be $=-1$ in the search for quaternions?
In fact, if you require that your "number system" be a division algebra (over the real numbers), it turns out that there are just four such systems: the real numbers, the complex numbers, the quaternions, and the octonions, so each of these is quite special. John Baez' paper "The Octonions" is a superb starting place for exploring this circle of ideas.
(NB there are plenty of interesting "number systems containing the real numbers", i.e., finite-dimensional algebras over $\mathbb{R}$; in other words, division algebras are not the only interesting thing we can ask for.)
