There are incredibly rich connections between classical analysis and number theory. For instance, analytic number theory contains many examples of asymptotic expressions derived from estimates for analytic functions, such as in the proof of the Prime Number Theorem. In combinatorial number theory, exact formulas for number-theoretic quantities are derived from relations between analytic functions. Elliptic functions, especially theta functions, are an important class of such functions in this context, which had been made clear already in Jacobi's Fundamenta nova. Theta functions are also classically connected with Riemann surfaces and with the modular group $\Gamma = \mathrm{PSL}(2,\mathbb{Z})$, which provide another path for insights into number theory. Farkas and Kra, well-known masters of the theory of Riemann surfaces and the analysis of theta functions, uncover here interesting combinatorial identities by means of the function theory on Riemann surfaces related to the principal congruence subgroups $\Gamma(k)$. For instance, the authors use this approach to derive congruences discovered by Ramanujan for the partition function, with the main ingredient being the construction of the same function in more than one way. The authors also obtain a variant on Jacobi's famous result on the number of ways that an integer can be represented as a sum of four squares, replacing the squares by triangular numbers and, in the process, obtaining a cleaner result. The recent trend of applying the ideas and methods of algebraic geometry to the study of theta functions and number theory has resulted in great advances in the area. However, the authors choose to stay with the classical point of view. As a result, their statements and proofs are very concrete. In this book the mathematician familiar with the algebraic geometry approach to theta functions and number theory will find many interesting ideas as well as detailed explanations and derivations of new and old results. Highlights of the book include systematic studies of theta constant identities, uniformizations of surfaces represented by subgroups of the modular group, partition identities, and Fourier coefficients of automorphic functions. Prerequisites are a solid understanding of complex analysis, some familiarity with Riemann surfaces, Fuchsian groups, and elliptic functions, and an interest in number theory. The book contains summaries of some of the required material, particularly for theta functions and theta constants. Readers will find here a careful exposition of a classical point of view of analysis and number theory. Presented are numerous examples plus suggestions for research-level problems. The text is suitable for a graduate course or for independent reading.