Symbolism, Imagery, Allegory
No matter which way you slice it, guns are an integral part of being in Dauntless. In fact, Dauntless get all the toys: trains, guns, knives, hamburgers, etc. That hardly seems fair.
But out of all those toys, it's the guns that give them the most power. After all, that's precisely why Jeanine manipulates them into fighting in her army—they know how to shoot, and they've got the guns to do it.
What we think is most interesting, though, is what guns mean to Tris. The first time she picks one up, it seems weird and scary: "It feels dangerous to me, as if just by touching it, I could hurt someone" (8.4). Which is true, to be fair.
But soon she starts to like the feeling of power, the feeling of being in control: "There is power in controlling something that can do so much damage—in controlling something, period" (8.22). And so, when Tris goes through her fear landscape, it seems natural that she would overcome her fear by imagining something that makes her feel in control—a gun:
What combats powerlessness? Power. And the first time I felt powerful in the Dauntless compound was when I was holding a gun.
A lump forms in my throat and I want the talons off. The bird squawks and my stomach clenches, but then I feel something hard and metal in the grass. My gun. (30.5-6)
So, for Tris, gun = power, right? Case closed, let's go get lunch.
Wait, not so fast. Tris does grow to associate guns with power in many cases, but not all cases. What about the scene in her fear landscape where she's given a gun and told to shoot her family… or she'll get shot instead (30.71)? Guns don't seem so fun, then. (Guns, like homework, really depend on which way they're pointed.) So here, even though Tris is holding a gun, she doesn't feel in control. And how does she gain control over this fear scene? She lets go of her gun and lets herself be sacrificed: "I release the trigger of my gun and drop it. Before I can lose my nerve, I turn and press my forehead to the barrel of the gun behind me" (30.90).
Now, you could point to the rest of the story, where Tris is acting like an action hero, shooting guards and shooting Peter in the arm. She's not against guns. But that fear scene where she lets go of her gun shows us that she knows that guns won't solve all her problems. Which is why, when she's faced with a mind-controlled Four, she gets him back on her side not by shooting him (which rarely works to get people on your side), but by giving up her gun and accepting her sacrifice.