Since \( f(x) = g(y) \) for all real values of \( x \) and \( y \), this means that for any value of \( x \), the value of \( f(x) \) is equal to the value of \( g(y) \), implying that both functions must be constant to maintain equality across all values of \( x \) and \( y \). Thus, \( f(x) \) and \( g(y) \) must both be constants.
- (A) is incorrect because there is no necessity that \( f(x) = 0 \) and \( g(y) = 0 \) for all \( x \) and \( y \); both functions must just be constants.
- (C) is incorrect because the assumption that \( f(x) \) and \( g(y) \) are not constants contradicts the condition \( f(x) = g(y) \) for all \( x \) and \( y \).
- (D) is incorrect because \( f(x) + g(y) = f(x) - g(y) \) implies that \( g(y) \) must be 0, which is not necessary given the conditions.
Thus, the correct answer is (B): both \( f(x) \) and \( g(y) \) must be constants.