Let A = {1,2,3,4,5}. Define a function f from A to A that is also a transitive relation, but is not the identity function.
Answer after the jump.
To succeed in this requires thinking of functions in the sense of “relations such that each element appears exactly once as the first element of a pair” and ignoring any pull toward functions as equations. The most general answer is to partition A, fix one element of each partition set, and map every element of that partition set to the fixed element. For example, map 1 and 2 both to 1, and map 3, 4, and 5 all to 4. Any constant function from A to A satisfies the requirements, at the size-1 partition end; the identity function arises from a partition of size 5. These are transitive because the only pairs of the form (a,b), (b,c) in the relation are those where b=c.