We calculate the pair distribution function, g(r), in a two-dimensional electron gas and derive a simple analytical expression for its value at the origin as a function of rs. Our approach is based on solving the Schrödinger equation for the two-electron wave function in an appropriate effective potential, leading to results that are in good agreement with Quantum Monte Carlo data and with the most recent numerical calculations of g(0). [C. Bulutay and B. Tanatar, Phys. Rev. B 65, 195116 (2002)] We also show that the spin-up spin-down correlation function at the origin, g ↑↓ (0), is mainly independent of the degree of spin polarization of the electronic system. 71.45.Gm