The F is not an automatic reject but it will be calculated into your UC GPA’s. Since UC’s are test blind, GPA is heavily weighted and it will affect your admission chances.
Grade replacement needs to be the same class. If the other course is very similar, then it could replace the F but up to the UC’s to make that determination.