If you have a pellet gun, it is a great first gun on which kids can learn all the safety habits.
I started by then 10 year old son on a pellet pistol - single shot. Mostly, because I didn't own a pellet rifle. We were very deliberate about THE FOUR RULES, and we started out in my father-in-laws back lot (3 acres). Once he was comfortable with the basics operation of the pistol and had decent safety habits (still needed a reminder on occasion, but wasn't ever unsafe), we started going to the range. This way, he was hearing other big bangs, but still not holding the big bang. Once, the noise was familiar to him and his fundamentals were getting good, we graduated to a single shot .22 rifle, and by the time he was 11, he received his first gun (Ruger 10/22) for his birthday.
He shoots well today, pistol or rifle, and has excellent fundamentals (he occasionally has lapses in disipline with the trigger that open his groups up a little). We have gone shooting with other experienced adults, and he frequently shoots better than they do. We are working on the shotgun sports now.