The main aim of the present work is to arrive at a mathematical theory near to the historically original conception of generalized functions, i.e. set theoretical functions defined on, and with values in, a suitable ring of scalars and sharing a number of fundamental properties with smooth functions, in particular with respect to composition and nonlinear operations. This is as they are still used in informal calculations in Physics. We introduce a category of generalized functions as smooth set-theoretical maps on (multidimensional) points of a ring of scalars containing infinitesimals and infinities. This category extends Schwartz distributions. The calculus of these generalized functions is closely related to classical analysis, with point values, composition, non-linear operations and the generalization of several classical theorems of calculus. In this first paper, we present the basic theory; in subsequent ones the theory of ODE and PDE. Contents 1. Introduction: foundations of generalized functions as set-theoretical maps 2 2. The ring of scalars and its topologies 3 2.1. Topologies on R n 6 2.2. Open, closed and bounded sets generated by nets 8 3. Generalized functions as smooth set-theoretical maps 11 4. Differential calculus and the Fermat-Reyes theorem 25 5. Integral calculus using primitives 29 6. Some classical theorems for generalized smooth functions 33 7. Multidimensional integration and hyperlimits 39 7.1. Integration over functionally compact sets 39 7.2. Hyperfinite limits 42 7.3. Properties of multidimensional integral 45 8. Sheaf properties 48 8.1. The Lebesgue generalized number 50 8.2. The dynamic compatibility condition 51 8.3. Proof of the sheaf property 52