Full Question
What happened to those who committed a mortal sin before the sacrament of confession was instituted?
Answer
They would have needed perfect contrition for their souls to be cleansed of mortal sin. Perfect contrition is having sorrow over sins that is motivated by love for God rather than the fear of punishment only. Since God is both perfectly merciful and perfectly just, they could still obtain the forgiveness of sins and the purification of the soul.
The scripture clearly state there is sin that leads to death and sin that does not. The scriptures clearly state that those who commit these sins will not inherit the kingdom of God. The scriptures repeatedly from the old to the new testament speak of culpability of guilt. The church did not invent mortal sin. It is found all over scripture