Can I transfer or sync purchased as well as non-purchased songs from my iPhone to my computer?
Things you've purchased off the iTunes Store can be transferred off your iPhone by right clicking on your iPhone in iTunes and choosing 'Transfer Purchases'. You might need to Authorise your computer first by clicking the Store Menu, and then choosing Authorise This Computer. 

For your non-iTunes Store content I'd recommend Senuti (read it backwards!) which lets you copy music from your iPhone or iPad back to your mac. Senuti costs $18, but there's a trial version, which can transfer up to 1000 songs.

Neither of these require a jailbreak.