By telling you that f(2) = 4, they mean that (2, 4) is on the line.
Similarly, f(-7) = 9 means that (-7, 9) is on the line.
Find the slope (y2 - y1)/(x2 - x1) = (9-4)/(-7-2) = -5/9
Now that we have the slope we can use either point and point-slope form:
y - y1 = m(x - x1)
y - 4 = -5/9(x - 2)
If the answer is allowed to be in point-slope form, that is all you need!
If you need slope-intercept form, solve for y by distributing and then adding 4 to both sides.
y - 4 = -5/9x + 10/9
y = -5/9x + 46/9
If you are asked for standard form, you can do that too by rearranging and multiplying by 9:
5/9x + y = 46/9
5x + 9y = 46