In Pokémon Y, HM04 Rock Smash is obtained at a specific story checkpoint:
Location: Talk to the man blocking the cave entrance above Ambrette Town (on Route 9, near the Glittering Cave entrance).
Requirement: You must have earned the Cliff Badge by defeating Grant, the Cyllage City Gym Leader (Rock-type specialist).
Result: He will give you HM04 Rock Smash and move aside, granting access to the Glittering Cave and onward to Geosenge Town.
Rock Smash is a Fighting-type move (40 BP) that can break cracked boulders in the overworld and has a chance to lower the target's Defense in battle. In Generation VI, HMs are not forgettable without the Move Deleter.