I will use log as log10
f(x) = 3 logx g(x) = 9 log x
g(x) = 3 f(x) ( remember that g(x) , f(x) are just notations for y)
so the function g(x) stretches f(x) vertically by a factor of 3 (B)
In case of shift , there is either a summed or subtracted term.