Here are some merchants you can sell stuff to:
Abernathy Farm - Connie
Drumline Diner - Trudy
Diamond City - Major hub/Many vendors
Good Neighbor - Minor hub/a few vendors
Grey Garden - Supervisor Green
Bunker Hill - Minor hub/a few vendors
Also vendors will visit your settlements (such as sanctuary) on occasion.
You will get a marker for Diamond City relatively early on during the quest:
When Freedom Calls
Obviously there are ways to increase your income, but I'm considering that outside the scope of this answer, and focusing on getting better prices.
Discounts
Some vendors will give you discounts for actions taken in the game, like Carla giving you a discount for making a sarcastic remark when you meet her. Shopping at vendors that give you a discount will help.
Raising Charisma
Much like raising intelligence for additional xp, you can raise your charisma for better prices. I keep a set of charisma gear on me, including clothes (+1-3 CHA), a hat (+1 CHA), and glasses (+1 CHA). I put these on before speaking with vendors, and it improves both buying and selling prices.
As an experiment, my character with 3 CHA sold some items without the CHA equipment (3 CHA), then I loaded and sold the same items with the equipment (7 CHA). I got approximately 200 caps without, and approximately 250 caps with.
You could also drink some alcohol first, which should pay for itself.
Perks
There's a perk for better buying and selling prices, called Cap Collector. I haven't tried this, but the exact numbers are listed on the fallout wikia.
You can also improve buying and selling prices with the perks you receive from finding Tales of Junktown Jerky Vendor magazines.
Other Items
Some specific items will give you a boost specifically to prices. Grape Mentats will give you 10% better prices and +5 Charisma for 8 minutes.
Best Answer
If you enable the console with an NPC in view you can just click on them and it will "select" them and display their id in the upper center of the console.
For example, I just did this with MacCready, and in the upper centre of the console it reads:
"(0002a8a7) [EP]
MacCready's ref id is 0002a8a7.