What determines a Pokemon's Hidden Power type in Pokemon Go?
Solution 1:
In Pokémon Go, as far as anyone can tell, it's random, likely determined when you click on the Pokémon like other aspects (CP, for example). The Silph Road doesn't seem to have done an explicit research task on it, that I can see; on the site there are threads on the that discuss it, always coming to the same conclusion without explicit evidence. Gamepress.gg apparently had an article about it, but the page doesn't exist anymore (even on the Wayback machine, oddly).
When you evolve a Pokémon with Hidden Power, that hidden power could change in type (it'll be rerolled, so it will probably change).