Hilchos Rechilus, chapter 9, section 11
All this is when he wants to warn him so he won't be cheated. But if the buyer already bought goods from someone, and he knows the seller cheated him — in the price or in other faults — it depends.
If by Torah law the buyer has no claim against the seller — because the overcharge was less than a sixth, or because enough time passed for him to show it to a merchant or a relative (after that time he can no longer return the item), or for any other reason the buyer loses out — then whoever goes and tells the buyer how so-and-so cheated him is surely breaking the ban on rechilus. Since by Torah law the buyer has no claim against the seller, his words are just plain rechilus.
Even if the cheated buyer asks him, he should not tell him the truth. And certainly, if he sees that his words might cause the seller a loss — for example, the buyer won't pay him the rest of what he owes, or will seize something of his — he should not tell. If he does tell, it is a great sin to bring this about.
But if he sees that by Torah law the buyer is in the right, and if the buyer knew, he would not agree to give it up, he must tell him the truth, so he can get back from the seller what he was overcharged — as long as he is careful about the following points.