If P, then Q. If Q, then R. Therefore, if R, then P.
The symbolic form looks like this;
The reason this is a fallacy is the same reason that affirming
the consequent is a fallacy. It does not follow that if the necessary
condition of one premise is present that the sufficient condition
of another will be. This is working backwards.
If it is raining, then it is cloudy. If it is cloudy,
then I'll be sad. Therefore, if I am sad, then it is raining. This
incorrectly assumes that the only possible reason for sadness is
rain. We know there are other causes of sadness. Rain is just one
of them (for this person).