Will retaking a class I failed raise my GPA?

The above statement is not actually true. If you took a course and got an F you can retake it and the F will be erased from the GPA. Any course with an F grade is repeatable at least once.

In terms of grad school they may factor both in but for UC undergrad purposes a repeat will erase the F. Don’t let confusion factor into this.