Investing in a merchant improves that merchant's disposition towards you, which can count towards becoming a Thane in the relevant Hold, if you are on the appropriate quest to help members of that hold. These merchants are not checked in the 'Invest' column in the following tables, but instead the bug is noted on the individual merchant page.
Some merchants are bugged - they have the dialogue allowing you to pay them 500 gold, but doing so does not result in any permanent change in the merchant's available gold. The merchants who have more gold are all identified in the notes of the following tables.