History of the Concept of a Ring
Solution 1:
For a nice introduction to the history of ring theory see the following paper
I. Kleiner. From numbers to rings: the early history of ring theory.
Elemente der Mathematik 53 (1998) 18-35.
SEALS: direct link to pdf, persistent link to article
Springerlink: direct link to pdf, persistent link to article
Solution 2:
Edit: Bill Dubuque has pointed out that much of this answer (specifically, the part about FLT) is essentially a mathematical urban legend, albeit a pervasive one. I cannot delete an accepted answer, so here is a link to an answer of his on MO explaining it.
Here is also a link to a related question.
There's some of the history here in Bourbaki's Commutative Algebra, in the appendix. Basically, a fair bit of ring theory was developed for algebraic number theory. This in turn was because people were trying to prove Fermat's last theorem.
Why's this? Let $p$ be a prime. Then the equation $x^p + y^p = z^p$ can be written as $\prod (x+\zeta_p^iy) = z^p$ for $\zeta_p$ a primitive $p$th root of unity. All these quantities are elements of the ring $Z[\zeta_p]$. So if $p>3$ and there is unique factorization in the ring $Z[\zeta_p]$, it isn't terribly hard to show that this is impossible at least in the basic case where $p $ does not divide $xyz$ (and can be found, for instance, in Borevich-Shafarevich's book on number theory).
Lame actually thought he had a proof of FLT via this argument. But he was wrong: these rings generally don't admit unique factorization. So, it became a problem to study these "generalized integers" $Z[\zeta_p]$, which of course are basic examples of rings. It wasn't until Dedekind that the right notion of unique factorization -- namely, factorization of ideals -- was found. In fact, the case of FLT I just mentioned generalizes to the case where $p$ does not divide the class number of $Z[\zeta_p]$ (the class number is the invariant that measures how far it is from being a UFD). And, according to this article, Dedekind was the first to define a ring.
The article I linked to, incidentally, has a fair bit of additional interesting history.
Solution 3:
There's also the books A History of Abstract Algebra and Episodes in the History of Modern Algebra (1800-1950).