The OEM batteries are generally pretty good...save for unusually harsh conditions, you can get 6+ years of life.
Easiest test would be a voltmeter across the battery terminals. Nominal voltage should be 12V of course, but if your battery is dead, you will see less than this.
If you can get your car started, again, measure the voltage, ensuring that accessories are off (radio, wipers, headlights, etc.). Your alternator should be producing 13.5 - 14.4V.
Anything outside of that range, and the culprit is the alternator. But more than likely, the voltage regulator needs to be replaced...the brushes have worn out.
I believe on your model, the regulator (about $30) can be replaced without having to remove or replace the alternator. Later ones have an internal regulator that requires swapping out the alternator.
2009 ML350 (84K) - Family vehicle
2001 CLK430 Cabriolet (71K) - Wife's car
2005 BMW 645CI (124K) - My daily driver
2012 Mustang V6 (60K) - Daughter's car