This post contains lots of spoilers!!
This dystopian novel is set in Chicago. We know nothing about what exists outside of the city, although a threat is hinted at. The citizens are divided into 5 factions that each revere a certain quality. Abnegation - selflessness, Dauntless - Bravery, Erudite - intellect, Amity - Peace, Candor - Truth. Each faction takes their quality to the extreme and believes that life would be better if that quality was more dominant.
Beatrice grows up in Abnegation. When citizens are 16, they are tested to see which faction they represent best. This testing is to help them choose which faction they want to join. Those that do not successfully go through initiation in their selected faction are called the factionless and live on the streets.
Beatrice's test results are weird. It show she has an affinity for Abnegation, Dauntless, and Erudite. It is very uncommon and taboo for someone to show an affinity for more than one faction - she is Divergent. Tori, the Dauntless woman administering her test, warns her to tell no one.
Beatrice knows she isn't selfless enough for Abnegation, but she doesn't want to disappoint her parents by not choosing Abnegation. At the Choosing Ceremony, she chooses Dauntless and her brother Caleb surprises her by choosing Erudite. Caleb has always seemed so perfectly selfless to her and there is a lot of tension between Erudite and Abnegation that is getting worse. Abnegation controls the government under assumption that you should give power to those that don't want it because they'll be less corrupt. It is also assumed that a desire for knowledge leads to a desire for power (which bothered me a lot until I realized that a lot of the factions have become corrupted versions of themselves). So the Erudite are trying to take over the government by discrediting the Abnegation.
She begins her Dauntless initiation. Just to get to their compound, she must jump onto and off of a moving train and jump off a building. The initiation consists of three parts. the first is physical training. Tris (she decides Beatrice no longer fits) is small and skinny so she doesn't do great at this, but she's not awful.
Tris makes some friends and enemies during initiation. Peter, Drew, and Molly make her life hell. But she makes friends with Christina (from Candor), Will (from Erudite), and Al. Al is big and strong, but cowardly and has a tough time with initiation. He also develops a crush on Tris, which she's not into. Tris begins to fall for one of the instructors who's called Four. Will and Christina also develop a romance.
The Dauntless initiation is ranked and only the top 10 get to become members. Tris is scared at first but then becomes determined to make it. Initiation is divided between transfers and those born into Dauntless. After the first round, Tris is ranked 7th in the transfers. Peter is 2nd and attacks the 1st ranked boy by stabbing him the eye while he sleeps.
The 2nd part of initiation focuses on mental preparation. They go through simulations of things that they fear. After the first simulation, Four pulls her aside and guesses that she's Divergent. Apparently Divergent can control the simulations. He tells her to be careful. Tris does very well on the 2nd round and is ranked first. Which of course means that Peter attacks her. Peter, Drew, and Al (!! he's obviously upset after her rejection) capture her and try to throw her into the chasm (a very fast moving river - to fall in means certain death). Four saves her. They spend the night in his room chatting. The next day Al begs her forgiveness and she refuses. The next day they find his body in the chasm - an apparent suicide.
The 3rd and final round of initiation involves going into your fear landscape, which involves a simulation of all your fears, one after another. Four invites Tris into his fear landscape, where she discovers why he's called Four - because he only has four fears (claustrophobia, heights, his dad, and killing someone) which is unheard of (most people have about 12) - and his real name - Tobias. He is the son of Marcus, an Abnegation colleague of her dad. Marcus abused Tobias when he was young and he chose Dauntless to escape him. They talk most of the night and kiss.
When it comes time for Tris to do her own fear landscape, she rocks. She has only 7 fears, one of which is a fear of being intimate with Four. After her fear landscape, the Dauntless leaders inject her with a tracking device, which they say they've done to all the Dauntless. At the initiation, she finds out she's been ranked first of all the initiates. After the initiation, she realizes that the Erudite are going to wage war on Abnegation and she figures out how - by controlling the Dauntless so they'll fight for them.
Her fears are confirmed when she wakes up to find everyone in her dorm sleepwalking. She realizes that the control doesn't work on her because she's Divergent. She plays along so she's not discovered. She works her way to Tobias, who she thinks/hopes is also Divergent. And it turns out she's right. Eric, a Dauntless leader and rival of Tobias's is about to kill him. Tris and Tobias realize they have to break character to save him. Tris is shot in the shoulder as they try to escape. They are captured and brought to Jeanine, the Erudite leader.
She's developed a new serum that will work on the Divergent, which she will test on Tobias. Tris's should injury is bad enough that she'll just be executed. The serum works on Tobias and Tris is taken away. She is able to escape thanks to her mother who she discovers grew up Dauntless and is also Divergent. Her mother ends up sacrificing herself so that Tris can escape and protect her father and brother.
Just before Tris gets to their hideout, she has to face a Dauntless soldier - Will, who she is forced to kill. She makes it inside to find her father, Caleb and Marcus (Tobias's father), and several other Abnegation. Her father patches up her shoulder. She decides they need to stop the simulation. Tris deduces that the simulation is being run from the Dauntless control room. Her, her father, Caleb, and Marcus head to the Dauntless compound while the rest of the Abnegation head to take refuge with the Amity.
In the Dauntless compound, she comes across Peter, who is not under control - because the Dauntless leaders decided it was unnecessary with him (undoubtedly because he's naturally so cruel). he offers to tell her where the control room is if she'll take him with her when she escapes. She agrees and her and her father leave Caleb, Peter, and Marcus behind and continue on to the control room. Her father sacrifices himself so she can get there safely.
She finds Tobias alone in the control room. He attacks her but he's able to shake off the mind control just in time. They shut off the simulation and take the computer chip with them so no one else can use it. Tobias, Tris, Caleb, Peter, and Marcus are able to escape on the train and head to the Amity.