The green graph is from f(x)=x, and we are asked to change the slope of the original line to 5 and the y-intercept to 2, so in the equation we multiply the x by 5 and add 2, you answer was correct, the two in the equation represent a translation in the y-axis, to translate in the x-axis we need to sum or substract from the x directly, for example if it was a translation in the x-axis the formula would be:
Since it is in the y axis the correct answer is: