I am studying algebraic geometry, and naturally came across the notion of regular functions as a way to make any algebraic variety a space with functions.
My problem with the notion of regular functions is that it seems arbitrary. Why study functions $f$, that are locally of the form $f=\frac{g}{h}\in \mathbb{C}(x_1,\ldots,x_n)$? Is there any motivation for this from the geometric, algebraic, or historical viewpoint?
I would greatly appreciate it if you could provide concrete reasons -via examples or particular theorems- showing that your proposed motivation makes sense in the context of algebraic geometry.
Maybe I am misunderstanding the focus of the question, but you are studying algebraic geometry, not differential geometry, so it is natural to work with polynomials as functions on affine space. If you want the fraction field you get rational functions. Were you expecting to be working with something that locally looks like $e^{-1/x^2}$ as a function?
If you work with varieties more complicated than affine or projective space then the ring of functions (or function field) can become more complicated than polynomials or rational functions, but the function field will consist of what classically would be called "algebraic functions" like $\sqrt{1-x^2}$, not something like $\sin x$.