Is it necessary that fo(g+h) is always equal to (fog) + (foh)? Explain using an example.
No.
Let us consider f(x) = x2 , g(x) = 3 and h(x) = 1.
Then fo(g+h) = f(3+1) = f(4) = 42 = 16.
But (fog) + (foh) = f(3) + f(1) = 32 + 12 = 10.
Hence fo(g+h) is not necessarily equal to fog + foh.