How to fix a damaged door frame?
This door had been broken before, there is caulk or some type of filler at the edges of the break, where some stayed on one side, some stayed on the other. This will really give you a hard time to get the parts tight enough for glue to do it job. All caulk MUST be removed from the glue area. You can use a fresh blade in a razor knife to carefully pare it off. Any wood that gets removed needs to be minimal, important that no caulk remains, if it does it WILL be in the way. This is done after you remove the trim, and after the piece is separated the rest of the way from the jamb. This will aid in removing the caulk.

After it is all cleaned up, dry fit the part back in. The gap should draw relatively tight where you DID NOT carve the wood away. A hair line gap is ok. With it loosely in place, drill pilot holes in at least three key areas, 2 to 4 inches from the bottom, one a few inches from the strike. Here you can actually set a pilot above and below the strike, and at least one at or near  the top. MAKE SURE it is lined up flush as good as you can, perfect is good. Time spent here will pay off when you disassemble it to run the glue. Set your screws too. Keep the screws length so it only goes into the mating part about 1". Here, more is not better, enough is perfect. Adding glue will complicate matters.

Now is the time to add the glue after removing the screws. Use enough glue to make sure the faces of the break on both sides are covered. When you reassemble glue will be everywhere, so prepare for it. I usually have handy a sponge and a half filled 2 to 5 gallon bucket ready. Glue oozing out will hide the joint and you won't see squat until the parts are tight and you wipe the joint with a damp cloth, then it is almost too late. You will still have a little time to back the screw out a bit and force it back straight or flush and tighten it back up. It always happens, I get it flush dry, but as soon as I add glue the parts shift a little, and adjustment is always needed.

Let the glue dry, putty the gap created by the carving off the caulk sand flush add the new piece of trim and repaint.