Your Rival will give you HM04 Strength when you pass through Route 112 for the first time. You can get to Route 112 by heading north from Mauville City and then turning west.
However, you won’t be able to use this HM outside of combat until you beat Flannery and win the Heat Badge.
HM04 Strength Location (Step-by-Step)
As you enter Route 112 heading west, your Rival will appear.
Your Rival won’t battle you this time; they will instead heal your Pokémon and give you HM04 Strength. Route 112 is located between Route 111 and Fiery Path.
Here’s how to get there:
Step 1: Start at Route 111’s entrance, located north of Mauville City.
Step 2: Head north and use Rock Smash.
Step 3: Head west and meet up with your Rival.
Once you receive HM04 Strength from your Rival, it will be quite some time before you can use it outside of combat.
You’ll have to deal with Team Aqua/Magma first in Meteor Falls and Mt. Chimney before having the chance to defeat Flannery. Defeating her gives you the ability to use Strength outside of combat.
Using Strength Outside of Combat
HM04 Strength is primarily used in various caves in Hoenn, where giant boulders are present.
With Strength, you can push the boulders into holes to pass through. Some boulders lead to rare items as well.
One of the nearby places you can use Strength is on the Fiery Path. It’s a cave accessible from the same route you received HM04 Strength, Route 112.
Here are all the items you get in Fiery Path by using Strength: