It's easy to see that #f(x) = -3^-x# fits the bill, but how would you find the answer in general?
Suppose #f(x) = ka^-x# where #k in RR# and #a in RR#, #a > 0#. This will have the #x# axis as an asymptote, regardless of the values of the constants #k# and #a#.
Then if #f(x) > 0#:
#log(f(x)) = log(ka^-x) = log(k) -x log(a)#
or if #f(x) < 0#:
#log (-f(x)) = log(-ka^-x) = log(-k) -x log(a)#
In either case,
#log(abs(f(x))) = log(abs(k))-x log(a)#
#=(-log(a))x+log(abs(k))#
This is in the form of the equation of a line, with slope #-log(a)# and intercept #log(abs(k))#.
Let's try applying this to our given points:
#(x_1, y_1) = (0, -1)#
#(x_2, y_2) = (-1, -3)#
#(x_3, y_3) = (-2, -9)#
#(x_1, log(abs(y_1))) = (0, log(1)) = (0, 0)#
#(x_2, log(abs(y_2))) = (-1, log(3))#
#(x_3, log(abs(y_3))) = (-2, log(9)) = (-2, 2 log(3))#
These three points, lie along a line of slope #-log(3)# allowing us to deduce that #a=3#
The intercept, #log(abs(k)) = 0# so #k = +-1#
Since #f(x) < 0#, #k < 0# so #k = -1# and #f(x) = - 3^-x#