For algebraic topology, it really depends on what areas of you'll be studying. If you'll be looking into homology and cohomology, you should read Allen Hatcher's Algebraic Topology (chapters 2 and 3). If you're going to be spending your time on homotopy theory, then I'd recommend Arkowitz' book on Homotopy theory. Hatcher also treats homotopy theory, but I don't particularly like how he goes about that. Arkowitz is better for this, in my opinion.
For algebraic geometry, I don't know that there's a standard 'compact' text which will be of that much use in a first course. Perhaps Miles Reid's Undergraduate Algebraic Geometry.
For both things, I'd recommend learning some category theory. Learn about functors. In both algebraic geometry and algebraic topology we use functors to go from the "geometric" (or topological) world of spaces to the algebraic world of rings and groups (among other things). When you start your algebraic topology course you should aim to understand (for example) how the fundamental group is actually a functor from Top to Grp. When you start doing algebraic geometry, try to understand the functors which you're using there too. It helps understand the bigger picture.
In both cases, an in depth understanding of the algebraic objects at hand is absolutely necessary. In the case of a first course in algebraic topology, group theory is important. In the case of algebraic geometry, ring theory. Particularly a good understanding of polynomial rings is important - but then again, algebraic geometry is basically designed to help us understand those :)