How can I fix iTunes to sync apps and musics? I have used my own apple ID to sync music and apps for long times. About 5 months ago my friend installed a new app by his own apple ID on my phone and now unfortunately I can't sync any app or music. 

iPhone 5s
iTunes version:   12.0.1.26
iOS version:     7.0.4

How can I fix this problem ?
As @patrix said, check the Apple ID under Settings > iTunes and App Store on your phone. Also, make sure you DELETED the app your friend bought with their Apple ID before you try syncing to your iTunes on your computer.

Goes without saying, make sure your same Apple ID is used on your iTunes on your computer.