Introduction to ring theory? I've been teaching myself algebra these couple of months. I already went through the basics of group (Lagrange, action, class equation, Cauchy and Sylow theorems etc.) And I already have some linear algebra background. 
I started to read about rings and got really excited. 
Is there any book you can recommend to me for learning ring theory from the basics with a view towards algebraic geometry/topology?
(Locally ringed spaces seem extremely interesting and I'd like to approach them as soon as possible.)
 A: Atiyah-Macdonald has been the best introduction to commutative algebra from the moment it was published in 1969.
Actually I think it is one of the most extraordinary textbook ever published in all of mathematics .
It is exactly 128 pages long, hence also one of the thinnest mathematics books on the market,  but contains a mind-boggling quantity of material.
It starts with the definition of a ring (!) on page 1 but already in the exercises to Chapter 1 you will find a self-contained introduction to affine algebraic geometry, both classical and scheme-theoretic (and as an aside, remember that schemes were very new in 1969).
The book calmly goes on to chapter 11, the last one,  where different definitions of dimension are given but proved to be equivalent.
You will also learn in that chapter about Hilbert functions and regular local rings, two notions which play a great role in algebraic geometry.
I won't even try to summarize the other chapters: suffice it to say that every basic notion in commutative algebra is covered:  the Nullstellensatz for example is proved (or given as an exercise with hints) several times.
And the most remarkable feature of the book is that every proposition is proved, crisply but completely, without cheating or resorting to  hypocritical shortcuts  like "it is easy to see..."  or  "it is left as an exercise ..." 
There are other good books on commutative algebra: Bourbaki,  EGA, Eisenbud,  Patil-Storch, Zariski-Samuel, ... but they are  probably too advanced for a beginner, whom they might discourage rather than help.
I advise you to to use them as reference books  once you have studied a reasonable part of Atiyah-Macdonald.
 Good luck!
A: Another remarkable book is Miles Reid's Undergraduate Commutative Algebra.
It is quite elementary (as the title indicates) and very short: 153 pages.
It is written by a renowned algebraic geometer for budding algebraic geometers.
It  is chock full of pictures showing how to interpret geometrically algebraic notions: just look at the frontispiece of the book, which you can see in the link I gave  above.
That  frontispiece  is a very realistic picture of a module $M$ lying over its base ring $R$, illustrating in an amazingly visual way the maximal points of the support of $M$, the stalks of $M$, the generic point of $R$, etc.
Already in Chapter 0 (called "Hello!":  the author has a very friendly and amusing style) you will find pictures of the cuspidal cubic and of $\operatorname {Spec} \mathbb Z[\sqrt -3]$, hinting  at the amazing synthesis between geometry and arithmetic permitted  by scheme theory.     
In a nutshell, that very elementary  book exactly addresses the OP's wish to learn ring theory "with a view towards algebraic geometry" .
Edit
Since I have also recommended  Atiyah-Macdonald's book, how do both books compare?
Here is Miles Reid's point of view (page 12):
"[Reid's] book covers roughly the same material as Atiyah and Macdonald, Chaps. 1-8 but is cheaper, has more pictures, and is considerably more opiniated.
A: For general algebra my favorite is Abstract Algebra by Dummit and Foote. It's very very accesible for beginners but covers a huge amount of material. 
After getting comfortable with general abstract algebra and you want to move to commutative algebra with a goal of learning algebraic geometry (which I would assume from your tags) then I'd recommend Commutative Algebra: with a View Toward Algebraic Geometry.
Both of these are books you really need to go through some of the exercises when reading but if you do that you will get a lot out of them. 
A: Kaplansky's Ring Theory book is great.
A: I recommend P.M. Cohn's book: Introduction to Ring Theory. It has the advantage of being clear and concise (just over 200 pages). 
A: This question is old, but I figure I may as well throw my hat into the ring (pun possibly intentional).
Users in your situation should read the relevant chapters of Dummit and Foote and do the exercises, but this is not my relevant advice. The relevant advice is to get a book with your intention literally in the title: the book Commutative Algebra with a View Towards Algebraic Geometry by Eisenbud. The book is relatively straight forward, problems are mostly routine and well-motivated. It's less dense than books like Atiyah/MacDonald and other similar texts.
A: Dan Saracino's Abstract Algebra is a good way to get acquainted with the early concepts of ring theory.
A: The lecture notes of J.S. Milne: A Primer of Commutative Algebra.
