Traditionally, number theory is that branch of pure mathematics concerned with the properties of integers. It contains many results and open problems that are easily understood, even by nonmathematicians. More generally, the field has come to be concerned with wider classes of problems that have arisen naturally from the study of integers. Number theory may be subdivided into several fields, according to the methods used and the type of questions investigated. See for example the list of number theory topics. Mathematicians working in the field of number theory are called number theorists.
The term "arithmetic" is also used to refer to number theory. This is a somewhat older term, which is no longer as popular as it once was. Number theory used to be called the higher arithmetic, but this is dropping out of use. Nevertheless, it still shows up in the names of mathematical fields (arithmetic algebraic geometry , arithmetic of elliptic curves). This sense of the term arithmetic should not be confused either with elementary arithmetic, or with the branch of logic which studies Peano arithmetic as a formal system.
Fields
Elementary number theory
In elementary number theory, the integers are studied without use of techniques from other mathematical fields. Questions of divisibility, the Euclidean algorithm to compute greatest common divisors, factorization of integers into prime numbers, investigation of perfect numbers and congruences belong here. Typical statements are Fermat's little theorem and Euler's theorem extending it, the Chinese remainder theorem and the law of quadratic reciprocity. The properties of multiplicative functions such as the Möbius function and Euler's φ function are investigated; so are integer sequences such as factorials and Fibonacci numbers.
Many questions in elementary number theory appear simple but may require very deep consideration and new approaches. Examples are
The theory of Diophantine equations has even been shown to be undecidable (see Hilbert's tenth problem).
Analytic number theory
Analytic number theory employs the machinery of calculus and complex analysis to tackle questions about integers. The prime number theorem and the related Riemann hypothesis are examples. Waring's problem (representing a given integer as a sum of squares, cubes etc.), the Twin Prime Conjecture (finding infinitely many prime pairs with difference 2) and Goldbach's conjecture (writing even integers as sums of two primes) are being attacked with analytical methods as well. Proofs of the transcendence of mathematical constants, such as π or e, are also classified as analytical number theory. While statements about transcendental numbers may seem to be removed from the study of integers, they really study the possible values of polynomials with integer coefficients evaluated at, say, e; they are also closely linked to the field of Diophantine approximation, where one investigates "how well" a given real number may be approximated by a rational one.
In algebraic number theory, the concept of number is expanded to the algebraic numbers which are roots of polynomials with rational coefficients. These domains contain elements analogous to the integers, the socalled algebraic integers. In this setting, the familiar features of the integers (e.g. unique factorization) need not hold. The virtue of the machinery employed  Galois theory, group cohomology, class field theory, group representations and Lfunctions  is that it allows to recover that order partly for this new class of numbers.
Many number theoretical questions are best attacked by studying them modulo p for all primes p (see finite fields). This is called localization and it leads to the construction of the padic numbers; this field of study is called local analysis and it arises from algebraic number theory.
Geometric number theory
Geometric number theory (traditionally called geometry of numbers) incorporates all forms of geometry. It starts with Minkowski's theorem about lattice points in convex sets and investigations of sphere packings. Algebraic geometry, especially the theory of elliptic curves, may also be employed. The famous Fermat's last theorem was proved with these techniques.
Combinatorial number theory deals with number theoretic problems which involve combinatorial ideas in their formulations or solutions. Paul Erdős is the main founder of this branch of number theory. Typical topics include covering system , zerosum problems , various restricted sumsets , and arithmetic progressions in a set of integers. Algebraic or analytic methods are powerful in this field.
Finally, computational number theory studies algorithms relevant in number theory. Fast algorithms for prime testing and integer factorization have important applications in cryptography
History
Number theory was a favorite study among the Ancient Greeks. It revived in the sixteenth and seventeenth centuries, in Europe, with Viète, Bachet de Meziriac, and especially Fermat. In the eighteenth century Euler and Lagrange made major contributions, and books of Legendre (1798), and Gauss put together the first systematic theories. Gauss's Disquisitiones Arithmeticae (1801) may be said to begin the modern theory of numbers.
The formulation of the theory of congruences starts with Gauss's Disquisitiones. He introduced the symbolism
and explored most of the field. Chebyshev published in 1847 a work in Russian on the subject, and in France Serret popularised it.
Besides summarizing previous work, Legendre stated the law of quadratic reciprocity. This law, discovered by induction and enunciated by Euler, was first proved by Legendre in his Théorie des Nombres (1798) for special cases. Independently of Euler and Legendre, Gauss discovered the law about 1795, and was the first to give a general proof. To the subject have also contributed: Cauchy; Dirichlet whose Vorlesungen über Zahlentheorie is a classic; Jacobi, who introduced the Jacobi symbol; Liouville, Zeller (?), Eisenstein, Kummer, and Kronecker. The theory extends to include cubic and biquadratic reciprocity , (Gauss, Jacobi who first proved the law of cubic reciprocity , and Kummer).
To Gauss is also due the representation of numbers by binary quadratic forms. Cauchy, Poinsot (1845), Lebesgue(?) (1859, 1868), and notably Hermite have added to the subject. In the theory of ternary forms Eisenstein has been a leader, and to him and H. J. S. Smith is also due a noteworthy advance in the theory of forms in general. Smith gave a complete classification of ternary quadratic forms, and extended Gauss's researches concerning real quadratic forms to complex forms. The investigations concerning the representation of numbers by the sum of 4, 5, 6, 7, 8 squares were advanced by Eisenstein and the theory was completed by Smith.
Dirichlet was the first to lecture upon the subject in a German university. Among his contributions is the extension of Fermat's theorem on
which Euler and Legendre had proved for n = 3,4, Dirichlet showing that . Among the later French writers are Borel; Poincaré, whose memoirs are numerous and valuable; Tannery , and Stieltjes. Among the leading contributors in Germany are Kronecker, Kummer, Schering , Bachmann, and Dedekind. In Austria Stolz 's Vorlesungen über allgemeine Arithmetik (188586), and in England Mathews' Theory of Numbers (Part I, 1892) are among the most scholarly of general works. Genocchi , Sylvester, and J. W. L. Glaisher have also added to the theory.
A recurring and productive theme in number theory is the study of the distribution of prime numbers. Gauss conjectured the limit of the number of primes not exceeding a given number (the prime number theorem) as a teenager. Chebyshev (1850) gave useful bounds for the number of primes between two given limits. Riemann introduced complex analysis into the theory of the Riemann zeta function. This led to a relation between the zeros of the zeta function and the distribution of primes, eventually leading to a proof of prime number theorem independently by Hadamard and de la Vallée Poussin in 1896. However, an elementary proof was given later by Paul Erdos and Atle Selberg in 1949+. Here elementary means that it does not use techniques of complex analysis; however, the proof is still very ingenious and difficult.
Quotations
Mathematics is the queen of the sciences and number theory is the queen of mathematics. Gauss
God invented the integers; all else is the work of man. Kronecker
References

History of Modern Mathematics by David Eugene Smith, 1906 (adapted public domain text)

Essays on the Theory of Numbers, Richard Dedekind, Dover Publications, Inc., 1963. ISBN 0486210103

Number Theory and Its History, Oystein Ore, Dover Publications, Inc., 1948,1976. ISBN 0486656209

Unsolved Problems in Number Theory, Richard K. Guy, SpringerVerlag, 1981. ISBN 0387905936 ISBN 3540905936

Important publications in number theory