It is now an exceptional time for modern cosmology, when we can observe the universe with high precision and connect cosmological measurements with theory. The excitement about the advances of observational cosmology is accompanied by the awareness that we face some major challenges: we still lack compelling theoretical models for dark matter, (that accounts for the formation of the structure we see around us), and dark energy, which drives cosmic acceleration, as well as a deeper understanding of the mechanism that set up primordial conditions, and these puzzles have deep roots in particle theory and gravity. I will focus on the challenge posed by dark energy and the quest of testing gravity on cosmological scales. I will discuss recent progress in identifying the optimal theoretical framework to tackle these in the context of large scale structure missions as well as direct detection of gravitational waves.