Where did topology come from, and what needs does it meet? Like many concepts, it was not created ex nihilo. Instead, a succession of approaches made it essential to turn vague notions into a sound theory.
The first stirrings can be traced back to Gottfried Wilhelm Leibniz in the late 17th century, when the German scholar and philosopher sought to create a new geometry, which he called analysis situs. Unlike the geometry of Euclid and Descartes, it would be not a "calculus of magnitudes" but a "calculus of situations".
In an admittedly very clumsy attempt to define the notion of a limit in order to justify that of a "differential," Leibniz explored another aspect that is now addressed using topology. This line of research was continued by Jean Le Rond D’Alembert in the following century, then by Augustin Louis Cauchy and Karl Weierstrass during the 19th century.
Leonhard Euler took a very different approach with his famous Königsberg bridge problem, although he almost certainly regarded such considerations as little more than a curiosity.