Why is this category invalid? According to the Haskell wikibook on Category Theory, the category below is not a valid category due to the addition of the morphism h. The hint says to " think about associativity of the composition operation." But I don't don't see why it fails.
$$
f \circ (g \circ h) = (f \circ g) \circ h\\
f \circ (\mathit{id}_B) = (\mathit{id}_A) \circ h\\
$$
Does this then reduce to  $f = h$ ?
And is that not true because f and h, despite both being from B to A, are not equivalent?

(source: wikimedia.org)
 A: It not so clear what is they mean, but I guess what they mean is that if you consider the graph above (in which edges with different labels are different) then you cannot put on that graph a structure of a category.
To prove that you have to use reductio ab absurdum:
if there where any category structure on that graph there should be a law of composition such that $g \circ h = \text{id}_B$ and also $f \circ g = \text{id}_A$ (that's follows for what is said in the link you posted above) and so it should also be the case that
$$f = f \circ \text{id_B} = f \circ (g \circ h) = (f \circ g) \circ h = \text{id}_A \circ h = h \ .$$
This would implies that $f=h$ but by hypothesis $f \ne h$ hence you've arrived to an absurd, so you cannot find any composition law that give to the graph the structure of a category.
Hope this helps.
A: hint: What is $hgf$? Write it in two different ways.
A: From the graph we see that $f$ and $h$ are inverse to $g$. Now it is a general fact about categories that inverses of morphisms are unique. The proof is the same as the one for groups.
