How does the state know when people transmute something into gold? In FMA, transmuting gold is against the law. However, I don't get this - How does the state know when people transmute something (e.g. bread into gold)?. 

There's nothing to stop someone from transmuting bread into a gold coin, walking into a store and then going on their merry way out as if nothing happened, because there's absolutely no way to know that it was bread to start off with. (Please correct me if I'm wrong. I haven't been watching the anime in a while and have only started re-watching again).

So, how will/how does the state know when someone has transmuted something into gold? How do they deal with this? e.g. imprisonment, fines etc.
Short Answer
Becoming rich isn't exactly subtle, and Locard's exchange principle suggests that there's always some way to get to the truth in matters like this.

Long answer
Let's be clear about something: This isn't Harry Potter, the state doesn't know when a transmutation is performed.* Mustang was sent to find Edward because they had heard about his abilities by word of mouth.

There is no surefire way to know whether or not an alchemist has created gold. While it is possible for them to do so, you'd find that any mechanism they had for catching said alchemists would be similar to the real-world practice of insider trading or counterfeiting.

In counterfeiting, there are telltale signs of illegal bills. In alchemy, transmutation marks are often left by alchemists as the science is not really a perfect one. As @looper mentioned, you could melt the gold, but then you'd still need equipment to put it back into bars or some tradable form. Alchemists aren't blacksmiths.

That said, there's exceptions. Consider Major Armstrong, whose alchemy is one of the most refined around, such that he leaves no transmutation marks on his average transmutation. Say he manufactures a few gold bars and sells them to pay for some under-the-table deals he made. The state would have no way of catching him&mdash;there is nothing that sets his gold apart from real gold, and they probably wouldn't even know about the deal to begin with.

However, say he starts doing it regularly. He upgrades his car, his house (even though he already has a mansion, go figure), wears a brand new watch, and so on. This is likely the point when the state would start to question where he acquired such funds (especially knowing his salary). In this case, he could be "audited" (assuming such a practice exists in-universe) and he'd likely be caught.

*Now, there is a point I have not addressed:


   Because, in Brotherhood, Father regulates all alchemical exchanges in Amestris, it's possible he'd have some way to look in on this. However, I highly doubt that, even though he essentially owns the state military and thusly all of Amestris, he'd care whatsoever about gold entering the country's economy illegally.


This answer probably got a bit more "real" than you expected, but I think that's just the truth. It's the same with their "creating humans" rule; they'd have no way to know you did it until you did something to make it clear.