Nonsmooth functions have been studied in analysis since the nineteenth century. This led to the theory of Sobolev spaces, which turned out to be the right tool to study nonlinear partial differential equations and calculus of variations. While the functions were not smooth, they were defined on smooth objects: domains in the Euclidean space or, more generally, Riemannian manifolds. By the end of the 1970s it had been discovered that a substantial part of harmonic analysis could be generalized to spaces that are not smooth, namely to spaces of homogeneous type which are metric spaces equipped with a so-called doubling measure. This included the study of maximal functions, Hardy spaces and BMO, but it was only the zeroth-order analysis in the sense that no derivatives were involved. The study of first-order analysis with suitable generalizations of derivatives, a fundamental theorem of calculus, and Sobolev spaces, in the setting of spaces of homogeneous type, has been developed since the 1990s. This area is growing and plays an important role in many areas of contemporary mathematics. It is known as analysis on metric spaces. As a sign of recognition, analysis on metric spaces has been included in the 2010 MSC classification as a category (30L: Analysis on metric spaces). You can find more information about the scope of applications of analysis on metric spaces in a recent brief survey paper that has some of the most important references to books and articles in the subject.
M. Bonk, L. Capogna, P. Hajłasz, N. Shanmugalingam, J. Tyson, Analysis in metric spaces. Notices Amer. Math. Soc. 67 (2020), no. 2, 253–256.