Let x∈f(A) exist, so x=f(z). Because z∈A, z∈X, z=g(f(z)).
Know x∈Y from x=f(z).
X=f(z)=f(g(f(z))=f(g(x))。
So x ∈ b.
So f(A) is included in b.
Take y∈B, then y∈Y, y=f(g(y)). Remember that u=g(y), then y=f(u). The following proves that u ∈ a.
Know u∈X from u=g(y).
And u=g(y)=g((f(u)).
So u∈A, so y=f(u)∈f(A).
So b is included in f(A).
So f (a) = b.