Brock obtained Marshtomp, as a Mudkip, in A Mudkip Mission. Mudkip lived at a pond where a number of Mudkip were bred for the Pokémon League. While most of the Pokémon left the pond as they grew older, the one that Brock caught was already mature and acted as a guardian of the younger, smaller Mudkip. Old Man Swamp, the owner of the pond, felt that the Pokémon League would not want to give a grown-up Mudkip to a beginning trainer. Brock eventually befriended it after a few failed attempts. Soon, Mudkip, Brock, and Brock's other Pokémon, Forretress and Lotad, had to rescue a baby Mudkip from falling over a waterfall. They managed to save it, but just in time for an attack from the Team Rocket. However, the Mudkip, along with Brock's Lotad, all used Water Gun on the ground by their mecha to make it sink into the ground, and Ash's Pikachu finished the job with Thunderbolt. Old Man Swamp later suggested that Mudkip go with Brock, to which he happily agreed.
Mudkip's debut appearance saving a baby Mudkip
In Turning Over a Nuzleaf!, Mudkip, along with Pikachu, Treecko, Corphish, Torchic, Silcoon and Lotad, were separated from the group after a Loudred attack. Mudkip, along with Pikachu, attempted to lead the group of Pokémon as they searched for Ash and the others. However, a group of Nuzleaf captured the Pokémon one by one after Corphish damaged the leaf on one of the heads of a Nuzleaf. However, Pikachu and Mudkip tried to save them until Ash and the group arrived.
Brock and Marshtomp
Mudkip was seen a little bit in Hoenn, usually alongside Brock's Lombre. They would usually use a dual-Water Gun attack. Mudkip has also been used occasionally for searches by using the fin on top of its head. It, along with Pikachu, usually broke up fights between the other Pokémon in the group. Brock decided to bring Mudkip with across the Kanto region for Ash's Battle Frontier challenge.
In A Chip Off the Old Brock, Mudkip evolved into a Marshtomp during a training battle versus Ash's Grovyle and automatically learned Mud Shot due to its new type gain. It then became smitten with a Flaaffy, as Brock was smitten by its Trainer.
Brock later decided to enter a Pokémon Contest in attempt to win the heart of a Trainer in What I Did For Love!. Marshtomp was also convinced, and Brock decided to use it in the Contest. It performed rather well, but was defeated by May's Eevee.
Brock left Marshtomp at the Pewter Gym when he decided to join Ash in the Sinnoh region.
Personality and characteristics
Initially as a Mudkip, it was distrustful of strangers and was very protective of those it cared for, similar to Ash's Bulbasaur. This is shown in its debut appearance where it viewed Brock and the others as intruders of its land. Once Brock gained its trust, it turned into an extremely loyal Pokémon and felt safer around strangers. During its travels with Brock, it was shown to be more of a sensible type usually assisting Pikachu in helping break up and resolve arguments between the other Pokémon. It's also friendly with younger Pokémon. When Mudkip became Marshtomp it retained the same personality but also had somewhat of a flirty side like its Trainer.
Marshtomp was often used to help track down Team Rocket after they had stolen a Pokémon using the fin on its head to detect vibrations. It would also use this to help find a missing person like how it did as a Mudkip in A Real Cleffa-Hanger where it helped to try and find Misty and Max.