Although you can view music on your iPhone via the Music app, it doesn't give you any hint of where the music files are stored on your iOS device. Actually, music stored on an iPhone is placed inside a folder called "Music" in your iPhone's internal storage. However, Apple prevents users from accessing it and thus you won't be able to access the music files on your iPhone directly.
Luckily, there is still a chance for you to access music files on your iPhone: You can either jailbreak the iOS device or use a file management tool to access and manage your iDevice content.
As you may know, jailbreaking an iPhone may cause security issues. While using a file management tool can not only enables you to access music files on iPhone but also allows you to transfer music from iPhone to another device, be it a computer or iPhone/iPad/iPod touch. Thus, using such a file manager is advisable for you to view and access music on your iPhone.
Now you know you need an iOS content manager to access music files on your iPhone. Here I recommend you try the iPhone transfer software - EaseUS MobiMover. With it installed on your PC or Mac, you will be able to:
To access music files on iPhone from PC or Mac:
Step 1. Connect the iPhone to your PC and run EaseUS MobiMover. In the Content Management section, click "Audio" and select "Music" to continue.
Step 2. Now you can access all music files on your iPhone. Select the items you want to transfer. (You can click "Settings" to change the storage path if you need to.)
Step 3. Click "Transfer to PC" to start transferring music from iPhone to computer.
Similarly, you can also view iPhone photos on PC with the help of this iOS content manager. Besides, if you need to put music on your iOS device someday in the future, you can either transfer music from computer to iPhone or download online music to your device using this tool.
Apple protects your iPhone data and disallows you to access your iPhone internal storage (except for photos). Therefore, you won't be able to access music files on your iPhone directly unless you jailbreak your device or use a file management tool to help.
Given potential issues that may be caused by jailbreak, you should use a tool like EaseUS MobiMover to get it done. With it, you can access and manage your music files by adding, deleting, or transferring items freely.