Gym Leader
A Gym Leader (Japanese: ジムリーダー Gym Leader) is the highest ranking member of a Pokémon Gym. The main job of a Gym Leader is to test Players and their Pokémon so that they are strong and resourceful enough to compete against the Elite Four in the games or the Pokémon League in the anime. If a Trainer defeats a Gym Leader in battle, then the Trainer earns that Gym's Badge.
A Gym Leader's job is not just to test upcoming Trainers. They must oversee how their respective Gym is run and to maintain it. Great care must be taken to make sure that their Gym reflects the best environment for the Pokémon type and playing style of choice, usually an environment that suits that type of Pokémon used there (like pools in a Water Gym or flowers and plants in a Grass Gym). According to Morty, teaching young people how to battle with Pokémon can also be the job of a Gym Leader.
It has not exactly been made clear how Gym Leaders attain their position, but it appears that it varies for each Gym. Some of them founded their Gym and are self-appointed; others, such as Whitney, are chosen by the other members of the region's Pokémon League. A few appear to be passed on through families: Janine, Falkner, and Flannery all take over their respective Gyms from a close family member. However, Gyms do not necessarily belong to a particular family; Roark and his father[Byron are both Gym Leaders at the same time, in different Gyms. Leaders can also choose to vacate their position; examples include Koga, Giovann], and Wallace.