In most cases, it is a roofing contractor who will perform the inspection. He will look at wear and tear, material, and the overall condition of the roof before certifying it. Certification usually lasts two years so that if the roof is damaged or leaks during that time, the certifying contractor will repair it for free.
The type of roof you are looking at has a big influence on the certification process. For instance, a wood or shake roof over ten years of age will generally need repairs to get to certifiable just because of the nature of the roof.
In addition to that, if you are looking at a flat roof you will likely not be able to get it certified. Flat roofs are entirely too difficult to repair in the eyes of most contractors so they will not even get involved with them. That is good to know when you go to buy or sell a home.
There are other instances in which the roof is just beyond repair. It is too hold, has too much previous damage, or even has damage that was never repaired before. In such a case, the contractor will likely refuse to certify for the next owner and will recommend that a new roof installation before a sale is even considered. This may be costly to you the seller or up the price for you as buyer, but in the end it is better to have a safe and complete roof than it is to save a few dollars up front on the home. You would likely have to make the replacements very soon no matter what anyway.
The process of trying to get a roof certified through inspection is not always an easy one. Along the way there will minor repairs that have to be made, but it is worth it to give the new owners of the home peace of mind, if only for a year or two. So keep it in mind when you go to buy or sell, that you will need to get your roof certified so that new owners will feel like they are getting a good home for the money they are spending.