For every connection on a smooth manifold there is a corresponding curvature tensor. Any diffeomorphism $\phi:(M,\nabla^M)\rightarrow(N,\nabla^N)$ which preserves the connection (in the sense of $\nabla^N_X{Y}=\phi_* \left( \nabla^{M}_{\phi^{-1}_*(X)} {\phi^{-1}_*(Y)} \right)$ ) preserves the curvature tensor.
My question is about the "reverse direction":
Does every diffeomorphism which preserves the curvature preserves the original connection behind it? I suspect the answer is negative but I could not come up with an example.
There are many different connections on the same manifold which share the same curvature tensor.
For example, take a connection $\nabla$. If $A$ is any global positive function $M\to R$, consider the connection $\tilde \nabla$ given by:
$$\tilde \nabla_X Y := \nabla_X Y + X(A)Y \;.$$
It is linear on both entries, and: $$\tilde \nabla_X (fY) = \nabla_X (fY) + X(A)\,fY = X(f) + f\tilde \nabla_X (Y), $$
so it is indeed a connection. Its curvature is given by: $$ \tilde R(X,Y)\,Z = [\tilde\nabla_X,\tilde\nabla_Y]\,Z - \tilde\nabla_{[X,Y]}Z. $$
If you insert the expression for $\tilde \nabla_X Y$, the terms in $A$ cancel out, giving you exactly the same curvature as $\nabla$.