How many linear functions (functions of the form f(x)=ax+b ) are equal to their own inverse?

The only functions that work are f(x) = x and f(x) = -x. So there are two functions that are their own inverses.