Why must He be truly human and also perfectly righteous?
Because the justice of God requires that the same human nature which has sinned should likewise make satisfaction for sin, and one who is himself a sinner cannot satisfy for others.
Scripture references
Why must He in one person also be truly God?
That He might, by the power of His divinity, bear in His human nature the burden of God's wrath, and might obtain for and restore to us righteousness and life.
Scripture references
Who then is that Mediator, who is in one person both truly God and a real, righteous human being?
Our Lord Jesus Christ, whom God has made for us wisdom, righteousness, sanctification, and redemption.
Scripture references
How do you know this?
From the holy gospel, which God Himself first revealed in Paradise, then proclaimed through the patriarchs and prophets and represented through the sacrifices and other ceremonies of the law, and finally fulfilled through His only begotten Son.