Rub the piece of gold across a piece of unglazed porcelain tile. It should not make a black streak. If it does then it is pyrite.If the streak is golden yellow then it is gold.
Try scratching glass with the piece of gold. If it scratches the glass, it is definitely not gold, or is mixed with other metals and the purity is very low.
Hold a magnet near the piece of gold. If the magnet attracts the gold piece, then there are other metals mixed in the gold. This is not pure gold. On the flip side just because something is not magnetic does not prove that it is gold. Brass, copper, aluminium are not magnetic. Pure nickel is magnetic, but when alloyed in jewelry it has very little magnetism.
A neodymium or rare earth magnet
can be used to test for silver. Although silver cannot be picked up with a magnet, there is a different reaction between a rare-earth magnet and pure silver as opposed to the reaction to adulterated silver.
Drop a very small amount of hydrochloric or sulfuric acid onto the gold. If the gold begins to dissolve, then there is some other type of metal mixed with the gold and it is not pure.
Check to see if there are any markings on the piece. This will give you an idea of what karatage it might be although it does not prove it. It is possible to buy a machine for stamping jewelry for as little $11 so there is little to stop someone from just stamping a piece with any hallmark they choose. You should not conclude that just because the piece has a hallmark that it is genuine. Class rings marked Jostens 10K are usually good. A class ring ring marked Jostens Duratone has almost no scrap value.
You can buy a test kit
consisting of a series of acids, a touchstone and a needle. Different types of acid are used to test particular karats. For example an acid for testing 10-karat gold can be used for a 10-karat gold but it can not be used to test 14 or 18 karat gold. These kits can be bought for as little as $9. Nitric acid is the type of acid generally used, and you drop the acid onto a part of the piece where there is some wear. If there is no wear then make a small file cut. Wash the stone with 22k acid and wipe it with a cloth. Then, scratch the item back and forth a few times in a couple spots on the stone. Drop your various acids and see what happens. If the spot disappears, the item is a lower karat than the acid. If it passes 10k test, it is at least 10k. If it passes 14k it is at least 14k and so on. Some experienced testers use 14k acid only, and can judge the gold purity by the reaction.
An electronic gold tester will test gold jewelry by measuring the electrical conductivity of the metal. One thing to keep in mind is that these testers utilize a surface test and will only give you the karatage of the actual spot you are testing. You will need to test in several spots to ensure that you didn't just get one particularly fine area of the jewelry. Most gold plated jewelry is flash gold and is less than 5 millionths of an inch (1/8 micron) thick. For this kind of plating, the tester will report the plated area as being of a low karatage (e.g. 12K when the plating consists of 22K gold). The thicker the plating, though, the less accurate the tester will be as to the actual gold content of the piece being tested. If you suspect that the area you are testing is plated, try rubbing it with a rubber eraser and seeing if the reported karat value decreases with subsequent tests as this will be a clear indication of gold plating. This video demonstrates this:
High-end testers are required in order to detect gold plating, as they are able to detect karat values with the greatest accuracy and precision (in one karat intervals).
No electronic gold tester can test gold dust or powder. The best way to test gold in a powder or dust form would be through a destructive fire assay test. Alternatively, the powder or dust could be melted down into nuggets for non-destructive testing.