Composition of two functions is not commutative I have always been shown that the composition of two functions is, in general, not commutative with a counterexample. But can you give a more general proof of this statement (that is to say, one that is not based on a specific counterexample)?
 A: Functions $f$ and $g$ fail to commute  if for some $x$, $g(f(x)) \ne f(g(x))$.
Take any $f$ such that $f(x) \ne x$ for some $x$.  Now $g(f(x))$ can be chosen independently of $g(x)$, and in particular it can be some element other than $f(g(x))$.  
A: Well, I can give you a necessary condition for $f$ and $g$ to commute, and it may be obvious to you that this necessary condition is not always true:
For $f$ and $g$ to commute, we must have for all $x$:
$$
\left( \left. \frac{df(y)}{dy} \right|_{y=g(x)} \right) \frac{dg}{dx}
= \left( \left. \frac{dg(y)}{dy} \right|_{y=g(x)} \right) \frac{df}{dx}
$$
(Even when this condition is met, all you know is that $f(g(x)) = g(f)x)) + C$ for some constant $C$.)
The reason people give counterexamples, when an easy one can be found, is that this clearly plants the proposition in the false category, and also usually provides some insight as to why it is false.  There is nothing at all hinky about proof by counterexample; all mathematicians accept that, as long as you can prove the counterexample really contradicts the proposition.
(This is in contrast to proof by assuming the hypothesis and deriving a contradiction, which is acceptable to 99.9% of mathematicians but is considered distasteful for some lurist logicians.) 
A: In order to prove that something isn't true, it suffices to give one counterexample.  Commutativity of function composition fails in general because it fails for one pair of functions.  One could find two counterexamples, which would technically be more general than just one, or even an infinite family of counterexamples, but only one is needed.  
If this is unsatisfying, you could try to establish conditions on pairs of functions so that the two functions do commute under composition and then show that many/most functions pairs don't satisfy these conditions, or find conditions on a single function $f$ so that $f$ commutes with all functions $g$.  This has been done with linear transformations, to some extent, or equivalently, with matrix multiplication.  Like function composition, matrix multiplication is not commutative in general.  One could ask what needs to be true about an $n\times n$ matrix $A$ so that $AB=BA$ for any matrix $B$ of the same size.  The answer is that $A$ must be a multiple of the identity matrix.  Since most matrices aren't multiples of the identity matrix, most matrices do not commute with all other matrices.
Edit: I see Mark Fischler has done this for differentiable functions.
A: The plainest contradiction I can think of is this:

If functions all commute, then every group is abelian.

Which is quite clearly false. The proof of this implication is simple:
Take any two elements $a$ and $b$ of a group $G$ and define the functions $f_a$ and $f_b$ as follows:
$$f_a(x)=ax$$
$$f_b(x)=bx.$$
If all functions, including $f_a$ and $f_b$ commuted, then, where $e$ is the identity, we have $$f_a(f_b(e))=f_b(f_a(e))$$
$$f_a(b)=f_b(a)$$
$$ab=ba.$$
Hey, that makes algebra easier!
