Is the Merchant ability mandatory if you have two identical tiles?
Yes. If you are able to perform the Merchant's action, you must. This does involve a certain amount of trust, since you do not have to reveal your tiles to prove that you cannot perform the action. (On that point I would paraphrase the Love Letter rulebook on a similar point, which says "Don't play with cheaters".)

From the rulebook, page 5:


  Using a special action is mandatory unless otherwise written on the card. If the action is impossible, it is ignored.