first, change f(x) to y
[tex]y = ax + b[/tex]
then
[tex]y - b = ax \\ \frac{y - b}{a} = x \: \: \: \: \: \: \: or \\ x = \frac{y - b}{a} \\ [/tex]
then flip x to y, y to x
[tex]y = \frac{x - b}{a} [/tex]
then change y to f^-1(x)
[tex]{f}^{ - 1} (x) = \frac{y - b}{a} [/tex]