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.)
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.