Let y = f(x). Then y = 2x+7.
Switch x and y to get x = 2y + 7
Solve for y: 2y = x - 7
y = (x - 7)/2
So, f-1(x) = (x - 7)/2 or equivalently, f-1(x) = (1/2)x - 7/2
Note: If you graph y = f(x) and y = f-1(x), you should see that the graph of y = f-1(x) is the reflection of the graph of y = f(x) in the line y = x.