You can only obtain a Rage Candy Bar from a man in Mahogany Town.
There is a man blocking the eastern exit in Mahogany Town, and you can buy a Rage Candy Bar from him. This is the only way to get a Rage Candy Bar in HG/SS, only one is obtainable because it is a Key Item in this game.
This is the man you're looking for:
![enter image description here](/pokebase/qa-plugin/https-img-proxy/image.php?key=91a9610c0e87f751&url=http%3A%2F%2Fwww.psypokes.com%2Fhgss%2Fwalkthrough%2Fmahoganytown1.png)