Tally writes a letter to herself about why she's doing this, so that when she comes back, she'll already have given her consent to the experimental pills.
Shay is also going to go in to the city, since she feels so guilty about ruining Tally's chance to be pretty. The good thing is that pretties with criminal pasts are really popular, so the two of them are going to rule New Pretty Town's social scene.
Now, that's what we call a happy ending.
They head off to the city. Tally thinks to herself that maybe she can avoid the brain lesions and remember what she felt for David.
At the end, they run into one of the city wardens and Tally identifies herself: "'I'm Tally Youngblood,' she said. 'Make me pretty'" (49).