The Hammer Punch in Sonic Rivals is straightforward once you know the requirements. First, it's a move that only Knuckles can perform, so make sure you're playing as him.
Next, you need to grab a Star power-up, which enables the attack. Once that's active, on the PSP you simply press the Triangle button to unleash the Hammer Punch.