You need to know differential geometry to understand general relativity and string theory. To understand differential geometry, you will need some elementary topology. For that topology, you will need need to know the basics of analysis. My suggestion for someone at your level would be to pick up Munkres' Topology and read the entire thing (even the sections on algebraic topology), as it is quite elementary and you may not need too much analysis to work with it. If you have trouble with it, you could always consult Rudin's Principles of Mathematical Analysis. Then once you have mastered Munkres, pick up Lee's Introduction to Smooth Manifolds and master it. Then you should be mathematically ready for string theory.
The mentioned texts are probably the most popular for their respective areas. This is precisely because they are so elementary, and they avoid esoteric topics that other authors include in their textbooks.