Quoting from an AMA on Reddit with Scientists and Engineers from the Curiosity Rover mission. read more
Curiosity team: Yes, Curiosity has a few ways to communicate with Earth. read more
The Curiosity rover can send messages directly to Deep Space Network antennas on Earth via X-band, but it is also able to uplink information to other spacecraft orbiting Mars, utilizing mainly the Mars Reconnaissance Orbiter and Mars Odyssey (if necessary) spacecraft as messengers that pass along data to Earth. read more