apply Set.infinite_range_of_injective
G : Type u_1
inst✝ : Group G
g : G
h : orderOf g = 0
⊢ Set.Infinite (Set.range fun i => g ^ i)
case hi
G : Type u_1
inst✝ : Group G
g : G
h : orderOf g = 0
⊢ Function.Injective fun i => g ^ i