Do Peter and Ender forgive each other at the end of Ender's Game? When Peter confesses to Ender, was that his way of forgiving Ender? When Ender wrote the book for Peter, was that his way of forgiving Peter?
(Keep in mind that there are many books that are relevant to this, some of them contradictory.)
In my opinion, Ender never forgave Peter, but he did give his understanding. In other books, Peter, having a strong political hold over Earth, does not allow Ender to come back to land for two reasons- one, for his own political gain, but also for his protection. He had the foresight to understand what was going to happen to all of the other battleschool graduates and sought to protect Ender from that by sending him to Shakespeare. While he was driven by self centered interests as well, there is no denying the fact that he was partially protecting Ender.
(The books do contradict some- At the end of the 1991 version of Ender's Game, in chapter 15, an abbreviated version of Ender in Exile is given. Peter wanted Ender to stay on Earth to act as a pawn for his own political gain. Valentine had to essentially bargain for his freedom.) One of the main reasons that Ender would have accepted this peace offering (so to say) was the addition of Valentine on the voyage to Shakespeare. Peter could have easily blocked Demosthenes from going, or even revealed who she was. Instead, he allowed her to be with Ender. Instead of acting spitefully and keeping her on Earth, Peter cared for the two of them.
Peter "forgave" Ender when he left Earth without fighting Peter's attempts. One of Peter's greatest fears is being overshadowed by Ender, which is one of the things that spurs him to become Locke and later much more. So, when Ender leaves Earth for Shakespeare, he essentially stops being a threat to Peter (and Peter can continue to use him politically.)
Finally, on the last page of the book, Peter asks Ender to be a Speaker for him. Ender agrees to write it for him. Now, one could argue that Ender only agrees because Peter is an important historical figure and he knew him as a child. However, it's made clear in the previous pages that what happens on Earth has little bearing on Shakespeare or any other worlds Ender is on, so Ender clearly is not very up-to-date on Peter's life. The fact that he is willing to sit and listen to Peter explain everything shows he finds value in telling Peter's story. Ender then wrote a fair, all-telling eulogy in the style of a Speaker. While this doesn't mean forgiveness for the evil he did as a child, it does mean that Ender did not hold some petty contempt within him. Ender viewed Peter fairly, and wrote for him as a man who had done right and wrong, not just bullied him as a child.
Even after his death, Peter continues to torment Ender well through Xenocide and Children of the Mind. I'm going to assume you haven't read those and won't spoil them- however, it is safe to say that both Peter and Valentine continue to have a profound effect on Ender thousands of years later.