Forthcoming as a chapter of a book to appear for SpringerBoth Frege's Grundgesetze, and Lagrange's treatises on analytical functions pursue a foundational purpose. Still, the former's program is not only crucially different from the latter's. It also depends on a different idea of what foundation of mathematics should be like . Despite this contrast, the notion of function plays similar roles in their respective programs. The purpose of my paper is emphasising this similarity. In doing it, I hope to contribute to a better understanding of Frege's logicism, especially in relation to its crucial differences with a set-theoretic foundational perspective. This should also spread some light on a question arisen by J. Hintikka and G. Sandu in a w...