Falsified evidence is a problem as old as law enforcement, so this is not a new problem.
One way to discredit fake evidence is by putting the chain of custody into question. How wasWhat were the circumstances under which the evidence was created? How was it obtained? Who can attest to that? Who had access to the evidence before it came to court? Is it guaranteed that nobody else had access? Does anyone in that chain of custody have reasons to falsify evidence? If no, then the evidence is probably reliable. This is actually already very common in our legal system of today. There are lots of forms of physical evidence which were very conclusive if true, but could be easily manufactured. Like documents (physical or electronic) or DNA samples. It's not uncommon that lots of potentially incriminating evidence is thrown out of court because the chain of custody is put into question.
Another way to prove evidence as fake is by looking at inconsistencies caused because who (or what) created the fake had to improvise on information it hadn't available. For example, when the fake sex tape shows physical characteristics of Celebrity A which don't match their actual body (yes, there are nude scenes of them from movies and modeling, but the public does not know that those also use AI technology to change certain features of their body). Or because it shows details of the filming location which don't match real-life.
Also keep in mind that AI technology can also help the legal system. For example by offering more reliable lie detection. The current lie detection technology (the polygraph) is known to be very unreliable. AI technology could be used to create far more reliable lie detection and use it to verify witness testimonies with higher accuracy.