TITLE: Showing that if $fg=gf$ and $fh=hf$, then $gh=hg$, where $f$, $g$, and $h$ are affine functions
QUESTION [5 upvotes]: Given real numbers $a$ and $b$ ($a \ne 0$), let $f_{a,b}$ be the function $\mathbb{R} \to \mathbb{R}$ defined by $x \mapsto ax+b$.  The set of such functions is a permutation group on $\mathbb{R}$, under function composition.
Let $f,g,h, \in G$, where $f$ is not the identity.  If $f$ commutes with both $g$ and $h$, show that $g$ and $h$ commute with each other.
(Problem from I.M. Isaacs)
I think I have proved this, but I'd like to be sure.
Let $f(x)=ax+b$, $g(x)=cx+d$, and $h(x)=mx+n$.  We have the following:
$$f(g(x))=acx+ad+b,\quad g(f(x))=acx+bc+d$$
For these two functions to be equal, therefore, we must have that $ad+b=bc+d$.  Am I correct in thinking that this further implies that $a,c=1$?
If so, then by essentially the same argument we also obtain $a,m=1$, and so $c,m=1$, which would imply that $gh=hg$ (since $g(h(x))=cmx+cn+d$ and $h(g(x))=cmx+md+n$).
Is this an effective proof?  It's clear that, for example in the first case, $a,c=1$ implies $ad+b=bc+d$, but it's not completely clear to me that $ad+b=bc+d$ necessarily implies $a,c=1$.
Thanks.

REPLY [3 votes]: Identify $x\mapsto sx+t$ with $\begin{bmatrix}s&t\\0&1\end{bmatrix}$, and you will be able to prove that composition of the affine functions corresponds to multiplication of the corresponding matrices. 
Now the given information that $fg=gf$ corresponds to $\begin{bmatrix}f\end{bmatrix}\begin{bmatrix}g\end{bmatrix}=\begin{bmatrix}g\end{bmatrix}\begin{bmatrix}f\end{bmatrix}$. Note that under this identification, $\begin{bmatrix}k\end{bmatrix}$ is a scalar matrix if and only if $k$ is the identity function. $f$ is not the identity function, and if either $g$ or $h$ are, the result is trivial.
If both $\begin{bmatrix}f\end{bmatrix}$ and $\begin{bmatrix}g\end{bmatrix}$ are diagonalizable, then since they commute, linear algebra tells us they are simultaneously diagonalizable. Since we can assume that neither matrix is a scalar matrix, then they have the same eigenspaces (each having two eigenspaces of dimension $1$ with distinct eigenvalues.) Ditto for $\begin{bmatrix}f\end{bmatrix}$ and $\begin{bmatrix}h\end{bmatrix}$. Therefore, assuming all three matrices are diagonalizable,  $\begin{bmatrix}g\end{bmatrix}$ and $\begin{bmatrix}h\end{bmatrix}$ have the same eigenspaces, are therfore simultaneously diagonalizable, and therefore  commute.
What if any one of these is not diagonalizable? In the case of $\begin{bmatrix}f\end{bmatrix}$, that would mean $a=1$ and $b\neq0$. So $f$ is a nonzero translation. Such a move only commutes with other translations. (If that is not geometrically clear, then you can deduce it from your formula with $a=1$ and $b\neq0$.) So $g$ and $h$ are also translations, and thus commute with each other. This argument can be spun around to apply if it's one of the other two functions ($g$ or $h$) that has a nondiagonalizable matrix.