I know that we can find the inverse of a function using solve e.g.
f(x):= a*x+b$
[invf]:solve(f=f(x),x);
However, I haven't been able to work out how to use this in the definition of a new function. I tried a few things, like:
invF(f):=rhs(invf);
but the f in rhs(invf) isn't recognized as the argument of the function invF(f). Is there any way to define an inverse, or would one simply work with this expression and use something like subst to evaluate it?