When buying or selling items, your Speech skill and perks improve the prices you get. Trading with merchants also improves your speech skill.

Merchants have a limited pool of gold to spend when purchasing items. This pool increases as they sell items, and will refresh every few days of gametime.

If you want to sell something to a merchant but he doesn't have enough money, he will offer you all of his money for that item. You can accept or reject the deal. Buy things from the merchant to replenish his gold.

Be sure to loot and sell everything you come across, as this will increase your speech skill. Having a high speech skill can make a huge difference when buying expensive items.

There are various perks all characters should consider, from the speech tree, that will give you an advantage when buying or selling items. The Haggling skill is the basic perk, you can increase it 5 times too get much better buying and selling prices. Allure gives you 10% cheaper prices if the merchant is the opposite sex as you. Once you have that perk, you should deal only with merchants of the opposite sex for the best prices. The merchant perk will let you sell ANY type of item to ANY type of merchant. This will make it easier for you to sell things and in return cause your speech skill to level faster. For example, you will be able to sell food to a weapons merchant or a magic tome to a armor merchant. The Investor perk lets you invest gold with a merchant to PERMANENTLY increase his or her available balance. The Fence perk will let you sell stolen goods to merchants that you have invested in,  and the Master Trader gives 1000 gold to all merchants so that they have more to barter with you.