The ability to break rocks is introduced in Pokemon Black 2 and White 2. In those games, you get Rock Smash from the Move Tutor in Undella Bay after you beat the Elite Four.
Remember, you can only use Rock Smash outside of battles to break rocks that have a shiny, sparkle effect!