Announce Your Intentions
The rules of golf tell the competitor to hit the ball where it lies. That means the only thing that is supposed to touch the ball is the face of the golf club. However, if you are uncertain that the ball you are about to hit is yours, you can check. To do it legally, you must verbally announce in a clear manner that you are about to check the ball before you lift it up. You also must get a signal from your opponent that he understands your intentions. If you do not make this announcement, there is a penalty of two strokes in stroke play and one hole in match play.
After your opponent knows your intention, mark the position of the ball and then lift it up to complete your examination. After you determine whether the ball is yours, place the ball in the exact spot where you found it. Your opponent should have the opportunity to watch this procedure if he so chooses.
No Additional Maintenance
You are not allowed to do anything else to your ball other than pick it up to determine whether it is yours. If you notice that it is dirty or caked in mud, you are not supposed to clean it or substitute another ball for it. You are simply making a determination of whether the ball is yours. If it is yours, you may continue your match. If it is not, you can continue to look for your ball. If you cannot find your ball, you may hit another and take a lost-ball penalty.