In 2 Timothy 1:18, St. Paul prays for Onesiphorus, who has died.
In 2 Maccabees 12:38-46, Judas Maccabee orders that sacrifices be offered in the Temple in Jerusalem for slain Jewish soldiers who had worn pagan amulets.
Why pray for the dead you ask?
All sin, unfortunately, has a life of its own and may have bad effects even after the sinner repents. Sincere repentance includes a desire to repair the damage done by ones sins. That may or may not be complete before the person dies.
Where do you get that from? There's no where what it says anyone died.