Clarke wakes up in her mind and sees her dad. She figures out that she dies, until he tells her that she is still alive and needs to figure out what is next. Clarke meets Josephine who explains there is only one of them who can keep this body, and Clarke runs back into a room where ALIE tells her that she is alive because she took the Flame. That prevents her from just giving in like her body was meant to. So to get Clarke out they would need to do what they did with Raven.
Clarke hides the memory but Josephine follows trying to get it. So Clarke sees Maya and uses that to overpower Josephine, who just comes back again and again.
Finally Josephine corners her in the forest where Clarke killed Finn and convinces her by using Bellamy to say she should give up.
Clarke gives up and waits for the end when Monty shows up and says she can't stop fighting. He pushes her to enter Jospehine's mind where she finds out more about how the Primes operate and what they plan. She also sees a moment Josephine wants locked away and uses that.
So when Josephine appears during a meeting with Russell and Bellamy to say she knows how to get rid of Clarke, Clarke and Monty alert Bellamy using Morse Code that she is alive. He catches on and tells Miller.