Yes, 1) will be the correct answer.
Domain of fog will be same as the domain of g(x) & range of fog will be same as the range of f(x):
so fog can be defined as:
fog: B --> B
fog(x) = x, such that x ∈ B.
So If any real number except 1, will be given to fog, it will produce exactly the same output as the input number.
=> fog(x) is Identity function on set B.
f = g-1 is also true since we getting fog = x.
fog = x implies that f is cancelling out the transformations applied on x by function g, that's why we are getting x as output.
fog is clearly a bijection, otherwise we would unable to define its inverse.
Now, domain of gof will be same as the domain of f(x) and the range of gof will be same as the co domain of g(x).
gof can be defined as:
gof: A --> A
gof(x) = x, such that x ∈ A.
So If any real number except 2, will be given to gof, it will produce exactly the same output as the input number.
=> gof(x) is Identity function on set A.
Here although expressions of fog and gof are equivalent but since their domain & co domain differ,they are not equal.
If two functions are equal then they must generate same output on EVERY input,
here if we give x = 1 to gof it will give 1 as output, but if we give x = 1 to fog, since it is not defined for x = 1, it will produce "Not Defined" as an output.
similar case for x = 2.
Thus since fog and gof are not generating same outputs on every input so they are not equal.
Also the graph of fog will be discontinuous at x = 1, & the graph of gof will be discontinuous at x = 2,(Removable Discontinuities).
---------------------------------------------------------------------------------------------------------------
# Examples of some functions that actually are not equal:
1) P(x) = 1, Q(x) = x/x : P(0) = 1, & Q(0) = Not Defined.
2) P(x) = x, Q(x) = √x2: P(-4) = -4 & Q(-4) = +4.
3) P(x) = x, Q(x) = (√x)2: P(-4) = -4 & Q(-4) = Not Defined.
4) P(x) = x, Q(x) = elnx: P(-1) = -1 & Q(-1) = Not Defined
and so on.