# Expected value of composite function

If we have two random functions f and g with Bernoulli distributions of p and p' (meaning that for function f for example its input is with probability 1-p is zero otherwise it equals to the function definition). Assume that the image of function g is within the domain of function f and x is a constant input within the domain of g. What is the expected value of the composite function E[f(g(x))|x]?

Can we say for any constant input x to function g we have the following:

E[f(g(x))|x]=pf(p'g(x))