[Abridged] In this paper, we present the results of a photometric survey to identify low mass and brown dwarf members of the old open cluster Praesepe (age of 590[+150][-120]Myr and distance of 190[+6.0][-5.8]pc) and use this to infer its mass function which we compare with that of other clusters. We have performed an optical (Ic-band) and near-infrared (J and Ks-band) photometric survey of Praesepe with a spatial coverage of 3.1deg^2. With 5sigma detection limits of Ic=23.4 and J=20.0, our survey is sensitive to objects with masses from about 0.6 to 0.05Msol. The mass function of Praesepe rises from 0.6Msol down to 0.1Msol and then turns-over at ~0.1Msol. The rise observed is in agreement with the mass function derived by previous studies, including a survey based on proper motion and photometry. Comparing our mass function with that for another open cluster with a similar age, the Hyades (age ~ 600Myr), we see a significant difference. Possible reasons are that dynamical evaporation has not influenced the Hyades and Praesepe in the same way, or that the clusters did not have the same initial mass function, or that dynamical interactions have modified the evolution of one or both clusters. Although a difference in the binary fractions of the clusters could cause the observed (i.e. system) mass functions to differ, measurements in the literature give no evidence for a significant difference in the binary fractions of the two clusters. Of our cluster candidates, six have masses predicted to be equal to or below the stellar/substellar boundary at 0.072Msol.