A linear function will have the form f(x) = mx + b.
f(0)=7 means the point (0,7) is on this line.
f(3)=1 means the point (3,1) is on the line as well.
Using those two points, we can find the slope:
m = (1-7)/(3-0) = -6/3 = -2
Since we were given f(0)=7, we also know the y-intercept.
So our function is f(x) = -2x+7