From the Super Mario Wiki
Ads keep the MarioWiki independent and free :)
A Chaos Emerald is a powerful gem found in the Sonic the Hedgehog series. There are seven in all, along with the more powerful Master Emerald (which hasn't yet appeared in any Mario games), and comparable to the seven relics needed in Super Mario RPG: Legend of the Seven Stars and the Paper Mario series. Once all are gathered, they turn Sonic into Super Sonic.
In Mario & Sonic at the Olympic Games, the Chaos Emerald appears in the Dream Race of the game. It acts as a rare item that can help make a major comeback. When a player uses the Chaos Emerald, it halts every opposing player in their tracks, and stuns them for a few seconds, as well as give the user a speed boost. This allows the player to get ahead easier, but, the effects wear off very quickly, but the opponents still have to gain speed again. In the DS version, the Chaos Emerald appears in the Dream Basketball. It can be used to let Boos bug the other players or can give the player more combo points.
In the Super Smash Bros. series, the Chaos Emerald appears during Sonic's Final Smash, Super Sonic. Once the Smash Ball is broken open, the Chaos Emeralds instantly appear around Sonic, causing him to transform. Also in these games, the blue Chaos Emerald appears in one of Sonic's victory poses if he wins a match.
They appear once again in Mario & Sonic at the Olympic Winter Games in the Dream Figure Skating event. The players collect them over the course of Green Hill and Death Egg, eventually using all seven to defeat a reawakened Perfect Chaos.
Chaos Emeralds also appear as an item in Mario & Sonic at the London 2012 Olympic Games Party Mode. In this game, they stun opponents for a few seconds.