In one level, asking for forgiveness and humbly accepting appropriate punishment is a righteous way of acknowledging fault -- and this is embracing justice. On the other level, not losing the willingness to be still accepting of the [undeserving] person despite his/her wrongdoing is giving the person a chance in and for righteousness -- and this is mercy.
Justice is giving each person what he/she deserves. Mercy is giving each person what he/she doesn't deserve.
Whoever shall keep the whole law, and yet stumble in one point, he has become guilty of all (James 2:10). Judgment is without mercy to him who has shown no mercy. Mercy triumphs over judgment (James 2:13). For God desires mercy, more than [animal blood and burnt offering] sacrifice (Hosea 6:6).
Blessed are the merciful for they shall receive mercy. (Matthew 5:7).