Invest in a shop and you get better prices there — the vendor cuts you a discount on their stock.
It's one of the more quietly useful mechanics in the game. Merchants each have a limited pool of gold, and raising your investment both improves your buy and sell margins and increases how much they can afford to trade, which matters a great deal when you're offloading expensive loot.