Presumably it was Riemann himself who proved the sufficiency of $R=0$ for the flatness. Spivak's Chapter 4 in Volume II of "A comprehensive introduction to differential geometry" is a good source on Riemann's work. It gives a translation of Riemann's inaugural lecture and of a part of his prize essay. At the end of the prize essay Riemann says (I am citing from Spivak):
Given an acquaintance with the traditional methods, it is demonstrated without difficulty that these ... conditions when they are satisfied, suffice...
meaning the vanishing of the components of the curvature tensor. Later in Chapter 4, Spivak gives a proof of this claim by a method that could have been considered "traditional" by Riemann.
EDIT: It is possible that the first published proof is contained in
Christoffel, E. B., On transformations of homogeneous differential forms of degree two., Borchardt J. LXX, 46-70 (1869). ZBL02.0128.03. [English translation included as Section 8 of Fagginger Auer, B. O. Christoffel revisited. MSc thesis (2011, Utrecht)]
Christoffel deals with equivalence of two metrics, not just flatness.