For the freshest, boldest cup of coffee, you want to use the freshest beans. If you're not sure if your coffee beans are stale or not, America's Test Kitchen offers this easy test: Put some beans in a ziplock bag overnight.
As the video above shows, coffee beans that were recently roasted (within seven to 10 days), the bag will pop up because of the carbon dioxide the fresh beans are releasing. The bag with the stale beans won't rise.
To avoid your coffee beans losing their freshness too soon, remember to store them properly in an airtight container if you're going to use the coffee in the next two weeks or in the freezer if not.
Are Your Coffee Beans Fresh? [America's Test Kitchen]