The question contain two functions H and G
H(n)-→ it gives the gray code value of n
G(n) → it gives the gray code value of (n+1)mod 16.so its output is between gray code values of 0-16.
so eg: n=5
H(5)=H(0101)=0111
G(5)=G(5+1 mod 16)=H(6)=H(0110)=0101
so G(n)=H(n+1) where 0<= n <= 15
so if you check g3 g2 g1 g0 for which inputs they are 1 then you get the answer which is C