Instructions
Travel to the Battle Tower. This is just west of Olivine City in the Johto region. When you enter the tower, there are some shops you can browse once you've earned some Battle Points and five additional areas where you can battle opponents.
Walk through one of the pathways to begin battling whenever you are ready. Whenever you enter an area, you are committing to a series of seven battles. These battles work the same way as the Elite Four battles; they are normal fights, but you cannot stop until you defeat all of your opponents or all of your Pokemon faint, in which case you must begin again. Defeating all seven trainers in a row gives you a streak and three Battle Points.
Defeat the boss of the area. For example, once you defeat seven trainers in the Battle Factory, you must defeat the Frontier Brain. Defeating him adds onto your streak, which increases the number of Battle Points you earn per stage. After defeating the boss, you are free to leave the area and heal your Pokemon as necessary.
Clear through additional areas until you increase your streak to 21. A streak of 21 permits you to fight the main boss, Palmer, who happens to be your rival's father from the previous games. Defeating him gives you 20 Battle Points.
Purchase TM26 when you have 80 Battle Points. Many Pokemon can learn Earthquake, such as Charizard, Dugtrio, Onix, Snorlax and Mew. However, you can only use a technical machine once, meaning only a single Pokemon can learn it, so choose wisely.