What kind of problems can occur from a long time leaking roof?
How can you locate the problems and how do you fix the problems?
That would depend on how long and how bad the leak is. A minor leak may only cause a little water staining of the surrounding wood. Constantly wet can cause dryrot of the wood. Bigger leaks can cause staining and water damage to drywall. If it remains wet then black mold can set in.
Detection: Detection is usually fairly easy, depending on the type of roof surface you have. Composition roofing (asphalt shingles ) can be visually inspected from the top. Most often there are missing pieces, allowing water to penetrate. Wood shake can also be inspected from the top. It is extremely common for the sun to burn holes through the shakes, then burn holes through the paper. Squirrels and birds like to bury nuts into older, softer shakes, sometimes tearing the paper underneath. With wood shake, the paper is what does the water proofing, not the shake, the shake only protects the paper from the sun and elements. Concrete/tile roofs I don't recommend the DIY'r mess with. The tiles become brittle and easily broken. Call and expert to inspect.
You can also do visual inspections from the attic. Minor leaks may not be visible, but the more prolific, the more obvious where the leak is. Look for staining of the wood members, staining to the back of the drywall and insulation. Look for daylight.
Repair: Composition roofs are the easiest to repair. There is installation directions on the back of every package as well as hundreds of "how-to" websites. Wood shake is easy enough to repair as well, though if you don't have experience with roofs in general, I wouldn't recommend a DIY'r attempt repairs. Concrete/tile - leave to the pro.