Travel to Puerto Rico
Since Puerto Rico is officially a territory of the United States, its residents are United States citizens and therefore can travel freely to and from the United States without a passport or visa. They simply need a photo I.D. to travel to and from the United States.
Traveling to Puerto Rico from the United States
United States citizens can travel to and from Puerto Rico with only a photo I.D. such as a driver's license. They don't need to obtain a passport or a visa. Obviously these days, it is probably wise to obtain a passport for more ease of travel in general, however it is not required.
For United States residents, they will need both their passport from their country of origin as well as a United States travel visa. So, even if you are traveling from the United States, you will still need to show your foreign passport and U.S. travel visa. However, you won't need to go through the customs process if you are traveling from the United States since you should have already gone through that process traveling to the United States.
Traveling to Puerto Rico from Europe or other countries
If you are traveling to Puerto Rico from any European countries or any other countries other than the United States, you will need to provide your foreign passport and a United States travel visa. You will also be required to go through the customs process when you arrive in Puerto Rico.