f (g(x)) = A[ Bx + A] + B = ABx + A^2 + B
g(f(x)) = B[ Ax + B ] + A = ABx +B^2 + A
So
[ f(g(x) - g(f(x)) ] = B - A
[ ( ABx + A^2 + B ) - (ABx + B^2 + A) ] = B - A
A^2 + B - B^2 - A = B - A
A^2 - B^2 + B - A = B - A
A^2 - B^2 = 0
(A + B) ( A - B) = 0
A + B = 0