Bernays spent his childhood in Berlin, and attended the Köllner Gymnasium, 1895-1907. At the University of Berlin, he studied mathematics under Issai Schur, Edmund Landau, Ferdinand Georg Frobenius, and Friedrich Schottky; philosophy under Alois Riehl, Carl Stumpf and Ernst Cassirer; and physics under Max Planck. At the University of Göttingen, he studied mathematics under David Hilbert, Edmund Landau, Hermann Weyl, and Felix Klein; physics under Voigt and Max Born; and philosophy under Leonard Nelson.
In 1912, the University of Berlin awarded him a Ph.D. in mathematics, for a thesis, supervised by Landau, on the analytic number theory of binary quadratic forms. That same year, the University of Zurich awarded him the Habilitation for a thesis on complex analysis and Picard's theorem. The examiner was Ernst Zermelo. Bernays was Privatdozent at the University of Zurich, 1912–17, where he came to know George Pólya.
Starting in 1917, David Hilbert employed Bernays to assist him with his investigations of the foundations of arithmetic. Bernays also lectured on other areas of mathematics at the University of Göttingen. In 1918, that university awarded him a second Habilitation, for a thesis on the axiomatics of the propositional calculus of Principia Mathematica.
In 1922, Göttingen appointed Bernays extraordinary professor without tenure. His most successful student there was Gerhard Gentzen. In 1933, he was dismissed from this post because of his Jewish ancestry. After working privately for Hilbert for six months, Bernays and his family moved to Switzerland, whose nationality he had inherited from his father, and where the ETH employed him on occasion. He also visited the University of Pennsylvania and was a visiting scholar at the Institute for Advanced Study in 1935-36 and again in 1959-60.
Bernays's collaboration with Hilbert culminated in the two volume work Grundlagen der Mathematik by Hilbert and Bernays (1934, 1939), discussed in Sieg and Ravaglia (2005). In seven papers, published between 1937 and 1954 in the Journal of Symbolic Logic, republished in (Müller 1976), Bernays set out an axiomatic set theory whose starting point was a related theory John von Neumann had set out in the 1920s. Von Neumann's theory took the notions of function and argument as primitive; Bernays recast von Neumann's theory so that classes and sets were primitive. Bernays's theory, with some modifications by Kurt Gödel, is now known as von Neumann–Bernays–Gödel set theory. A proof from the Grundlagen der Mathematik that a sufficiently strong consistent theory cannot contain its own reference functor is now known as the Hilbert–Bernays paradox.