There really isn't such a function $f$; encryption algorithms attempt to generate what looks like random bitstrings (at least, it looks that way to anyone who doesn't know the key), and because the plaintexts and the ciphertexts look unrelated, their hashes are also going to look unrelated.

On the other hand, what is the problem you're trying to solve?  When you say 'verify the integrity of a ciphertext', who is doing the verification?


Are you trying to allow the decryptor to verify that the message he got was the message that the encryptor sent without someone modifying it in the middle?  If that's the case, the standard way of addressing it is with a Message Authentication Code
Are you attempting to allow the encryptor to verify that the encryption process proceeded properly?  About the only ways to do that are to either run the encryption process again (with the same IV) and compare, or attempt to decrypt the ciphertext and compare.
Are you trying to allow someone in the middle (without the keys) to verify that a specific ciphertext happens to be a specific plaintext?  Well, that would be an unusual requirement; I don't have any bright ideas on that one.


Verifying the integrity of ciphertext using the cleartext hash?
I noticed that my players would pay everything in gold. A simple piece of bread? 1 copper. "Here, have a gold and keep the change." They get into a tavern. A beer! Here, have a gold coin and keep the change. They would give beggars gold coins like they are candies. They make a donation to the church. 10gp. That's a stupid amount of money in fiction. But for them that's nothing. They always spend their money on the most expensive stuff in the tavern and would request the inn keeper to open the most expensive bottle of elven wine he has and the players will pay 3 times the price of that bottle. Why? We're rich we don't care!

Most of the time, NPC will have never seen a gold coin in their life. A inn keeper maybe. A farmer, forget about that. My players don't really think about the social and economical consequences of that and I'd like that to change.

First, I have no idea how I should have my NPCs react except having them jump like they won the lottery. That would just encourage the players to continue. I want them to understand this is weird, unusual and almost out of character. I don't want to punish them, I want them to understand that would be the equivalent of donating 25,000$ to the girl at Starbucks.

Second, how would the setting change? Suddenly there's this town where the PCs are spending money like they don't know what to do with it. And as a matter of fact..they frequently don't. In my settings there are no Magic weapon Wal-Mart. Magic items are special and you can't simply buy them in a random village.

Edit: Assuming I'm playing in D&amp;D 3.5 (which is not the case but it's irrelevant anyway because the system is not important. I play in a D&amp;D 3.5-ish setting). Also assume I follow the recommended money-per-level table. I couldn't find the D&amp;D one but the one for Pathfinder is similar. I usually don't give them the equivalent of the loot in money. I split the loot like this: 75% of the loot in item and the rest in a mix of coins and random objects.
