What purpose does a GFI serve? Where should they be used?
A GFI, or GFCI - Ground Fault Circuit Interupter device protects us from receiving electric shocks from faults in the electrical devices we use in our home. It works by comparing the input current on the hot side to the output current on the neutral side. If there's the slightest difference in current, on the order of a few milliamps, then there is current leaking out somewhere, possibly through somebody's body. To protect us in this situation, the device very quickly cuts off the power supply to the leaking device, within 20-30 milliseconds, greatly reducing any possible human tissue damage from errant current.
GFCI proctection should be provided anywhere there is a receptacle installed in an area subject to moisture, as the presence of moisture greatly increases the danger of accidental shock. The National Electric Code specifies many such areas in residential dwelling units, such as, but not limited to: Bathrooms; Garages and accessory buildings; All exterior receptacles; Crawl spaces; Unfinished basements; Kitchens; Laundry, Utility, Wet Bar Sink Areas; and Boathouses. Local building authorities may have additional requirements. The list of areas requiring GFCI protection has increased with every code revision. They were initially only required around pool areas in the '70s. Now they seem to be required nearly everywhere. You should question your local building authority for the latest, complete requirements.
GFCI protection can be provided either at the outlet by the now familiar outlet with the test and reset buttons, or at the distribution panel by way of a GFCI circuit breaker, which protects all outlets on the circuit it controls. Additional outlets can be protected downstream of the local outlet type with push buttons by wiring the added outlets to the LOAD side of the local GFCI device.
Thus, it is not possible to tell if a receptacle is GFCI protected or not by just looking at it. If any particular outlet doesn't seem to be providing power, not only should you check the circuit breakers, but also check any GFCI outlets with push buttons in the area.
I would also add that adding a GFCI in a three wire grounded circuit may present problems using three wire portable devices. Many portable three wire devices connect the neutral and ground wire together in which some electrical current may return to the source through the ground wire.
I purchased a UL listed florescent light fixture and when plugged into a GFCI receptacle would often trip the GFCI when it was turn on. I ironically had to place a 2 prong to 3 prong adapter on it to isolate the ground wire on the fixture so that all of the current would return through the neutral wire. I could have cut off the ground prong from the fixture, however, that would have been dangerous because the fixture did not have the hot and neutral prongs polarized, i.e. neutral prong larger than the hot one. If I had just cut if off and plugged it into a non-GFCI circuit the metal case of the fixture may have become hot creating a shock hazard.
Most electrical fixtures and appliances these days are double insulated and usually don’t have a problem. Just be aware that not all 3-wire appliances will work properly when directly plugged into a GFCI circuit.
A GFCI is an automatic device that offers personal protection against lethal electrical shock or electrocution.
Three types of GFCIs are commonly used in homes – the GFCI outlet, the GFI circuit breaker and the portable GFCI. All of these GFCIs perform the same function but each has different applications and limitations.
More Detail of installation can be checked here:
GFCI Construction, Working & Operation