Why does solving for the inverse function leads $x$ to be a constant? I went down the wrong path in trying to show that; if $f(x)=ax+b$ then there is a $g(x)=dx+e$ such that $f(g(x)) = x$. This wrong path led me to a baffling result of x being a constant. Can anyone explain either my error or what it means?  Note that on my 2nd attempt I did derive $g(x)$, so that is not my question.  My question is what does the following mean?  How can x be a constant?
I did very simple substitution, just to see where it led me:

*

*if $f(g(x)) = x$ then

*$f(dx+e) = x$ and substituting;

*$a(dx+e) +b = x$ and expanding

*$adx +ae + b = x$ and grouping

*$(ad-1)x = -ae - b$

*$x = \frac{-ae-b}{ad-1}$ which is a constant

I know this is not how to get the inverse function.  I was able to figure that out.  But why do the above steps lead to an obviously impossible value for x?
 A: The problem with the reasoning is the same old division by zero. But this is very disguised.
Now, you start off with $f(g(x)) = x$, as an equality of functions : so  what this actually means, is that for every real number $r$ we have $f(g(r)) = r$.
Your manipulations led you to $(ad-1)x = -ae-b$, which continued to be an equality of functions.

At this point, you have divided both sides by $ad-1$. This has led to the functional equation $x = c$ for some constant $c$, which is a contradiction, and you feel you have done something wrong.
The truth is, you have obtained by contradiction that $ad-1 = 0$, because if indeed $ad-1 \neq0$ then the functional inequality $(6)$ would have held, which is not possible.
So no , $x$ cannot be a constant. Instead, the assumption that $ad-1\neq 0$ is false and has led you down this path, and once you tread it you know a contradiction awaits you. So that tells you $ad-1=0$.
Now, knowing that $ad-1 = 0$, from $(5)$ we get $ae+b = 0$. Thus, your objective of obtaining $d$ and $e$ in terms of $a$ and $b$ is achieved. Note that if $a= 0$ these constants can't be found.

Just want to add that if you want to derive $d$ and $e$ there's the easier method of substitution which you can use. As I mentioned earlier, a functional equality, upon substitution of appropriate numbers, becomes a numerical equality. So substitute numbers.
For example, suppose that $f(g(x)) = x$. Then substitute $x = 0$, to get $ae+b = 0$. Substitute $x = 1$ to get $a(d+e)+b = 1$, and solve these.
