I do not like undercutting either, but that's how you ensure a sale. If you don't like it, then wait until their item is bought, and then yours will be purchased afterwards. If the item is not selling fast, then why do you care if someone undercuts you, if you are looking to make gil fast, you should look to sell something that people want instead. Someone undercuts me for my ahriman clock, I just leave it alone and wait for someone to pay for it at the price I put it, but more common items I will readjust the prices over time depending on how low it drops, or leave it alone.

Alternatively, you could compete with them and keep undercutting them until it's worthless, and then buy all of their items and resell them for more.