At school we are taught that people who are good will go to Heaven and people who are bad will go to Hell. So if this is true, doing good deeds such as charity, fasting and worship of God should be our means of salvation from the Hell fire. And doing bad deeds such as murder, rape and stealing will lead us to the Hell fire. And this makes perfect sense. But I cannot find anything in the scripture about doing good deeds or being righteous men/women to attain salvation. Does anyone know if there is mention of attaining salvation through good deeds or being righteous people in the scripture?
According to Jewish thought, if we fulfill God’s will, we will be rewarded for our efforts, and if we sin against God, we will be punished .
"Good deeds" don't cancel bad deeds, and conversely, "bad deeds" don't cancel good deeds . A person is judged for each good deed or misdeed .
 "Ani Ma'amin" (11).
 See Pesachim 118a אין הקב"ה מקפח שכר כל בריה.
 See Rambam in "Iggeres HaSmad":
אבל השם יתברך נפרע מבני אדם על החמורות ועל הקלות, ונותן שכר על כל דבר שעושין. על כן צריך האדם לידע, שכל עבירה שיעשה נפרעין ממנו עליה, וכל מצוה שיעשה מקבל עליה שכר
"God punishes people for the severe and the light [sins], and gives reward for everything they do. Therefore, a person must know that for every sin that he commits, payment will be exacted from him, and any mitzvah that he does, he will receive a reward for it."