Were wealthy people and royals of medieval time able to distinguish real diamond/pearl/gold from fake? or did they rely on jewelers?
(Posting this as a speculative answer, since I doubt there are any credible sources out there to answer the highly specific question in your title.)
Until the industrial age you'd tell gemstones apart using the naked eye (and a magnifying glass if you had one). Synthetic gems weren't a thing until recently, but there were mundane crystals like quartz. It's not easy for an untrained eye to tell cardinal gems apart from mundane ones, so it's highly likely that you'd involve a jeweler of some kind to make sure. (This page has an unsourced story of a buyer acquiring sapphire for the price of quartz. I'd surmise it's an urban legend, but it's nonetheless a concrete example of where confusions might arise.)
As to precious metals, they were used as coinage because they were relatively corrosion resistant and easy to work, so it's sensible to speculate that someone accustomed with using them day in day out might be able to tell e.g. a brass coin apart from a gold coin. (Plus, gold is softer.) Anything beyond that would likely have required some kind of expert too.
(That said, I'm extremely suspicious that you'd encounter many coins made of non-precious metal that masqueraded as gold or silver in the medieval ages. A more sensible problem would have been clipping bits of metal off of genuine coins as described here. They used small balances like this one to detect them.)
The legend of Archimedes came to us from the medieval times. And notice, nobody found anything strange, on the contrary, it was natural that a ruler/king asks a specialist to check the item.
I haven't heard or read any mention about some royal family member to obtain a gemology or goldsmithing education. Without that we could only believe in some sacred abilities of the kings.
Counterfeit stones were often found in some historical crowns. Scotland, for example.
What is interesting, the meaning of the word counterfeit was different in the past. If some stone looked as a precious one, it was taken for a precious. For example, in the Czech crown of Charles IV, there are some stones that are not precious by themselves. But they were beautiful and that was enough. In the medieval times they would take artificial rubies for absolutely natural, even if they knew they were made. And any stone that was not a real ruby, but looked as such, and was harder than quartz, would be taken for a ruby, too. They could not tell two stones from each other, so these stones were the same for them. BTW, our science work the same way, only we can distiquish much better.
And only in Renaissance times European kings and aristocracy started to learn. Before that they were interested in theology and war craft at best. In Islam world, on the other hand, the science and art were highly valued. A legend about a king - carpet maker is well known.