The safest way to search for the history of a gun is to collect the serial number from the owner's manual or body of the gun and then ask a local official such as a gun shop or law enforcement department for its history. Barring seeking the help of a professional, websites such as hotgunz.com have public databases of stolen registered weapons. Note that these websites are not replacements for professional research -- just cursory first looks.
The only problem with running a search for a gun's serial number is actually finding it on the weapon. The serial number is listed in the owner's manual for the gun, but since an owner's manual can be lost, it is also printed somewhere on the body of the gun. Should the owner not have access to the manual, the serial number should be plainly visible upon a thorough inspection. Should the serial number not be found on the weapon, the person should contact the manufacturer of the weapon and ask about where the serial number is printed, as it may be more discreetly hidden on the inside of the gun.
Should the number not be visible in the appropriate location, the firearm should be reported immediately. Tampering with the serial number of a gun is illegal.
Very old guns may not have serial numbers associated with them at all, so be sure that vintage guns had actually been produced with a serial number before reporting.