I believe that Kant defended the "law of cause and effect" by stating this argument:
(P) If we didn't understand or acknowledge the law of cause and effect, we couldn't have any knowledge.
(Q) We have knowledge.
Therefore: (P) we acknowledge the law of cause and effect.
Isn't this line of reasoning a fallacy? P implies Q, Q, : P
It seems to me you haven't reported the inference accurately. The conclusion, "We acknowledge the law of cause and effect," is the negation of the antecedent of (P) and not, as you report, (P). (That is, your premise (P) is of the form: if not-X, then not-Y. And the conclusion of your argument is X.) So, the argument really has the form "If not-X, then not-Y" and "Y", therefore "X". This is a correct form of inference in classical logic. You're right that "If X, then Y" and "Y" do not imply "X"; that is indeed a fallacy. But this argument is rather of the form: "If X, then Y" and "not-Y", therefore "not-X". And that is a correct inference.