f(x)=1/x+2

how do i solve this

First tell us if the denominator is (x+2) or just x. The way you have written it, it is hard to tell.

You cannot say what x is with the single equation you have provided. You can only express it in terms of f(x).