Full Idea
The notion of a function evolved gradually from wanting to see what curves can be represented as trigonometric series. The study of arbitrary functions led Cantor to the ordinal numbers, which led to set theory.
Gist of Idea
Trying to represent curves, we study arbitrary functions, leading to the ordinals, which produces set theory
Source
report of George Cantor (works [1880]) by Shaughan Lavine - Understanding the Infinite I
Book Reference
Lavine,Shaughan: 'Understanding the Infinite' [Harvard 1994], p.7