https://en.wikipedia.org/wiki/Warren_v._District_of_Columbia
If the cops have a choice of stopping 2 crimes or the crime happening to you, they're going to choose the 2 crimes. Presumably you and definitely I would choose to prevent the crimes happening to ourselves. Thus, self defense.
No, that's not their duty, either.
They are a paramilitary force lacking the civilian supreme command that, in the US, the actual military has, empowered by but not obligated to act to enforce the law, an independent and centralized power center.
No. We should eliminate the cops (who have actively contributed to the current problem as a political protest to lobby for more control) and rebuild SF law enforcement as a non-monolithic function distributed in domain-specific units throughout local government (that component of the solution is not specific to SF, but SF is more accutely problematic than most places.)
Probably less of the total manpower directed to enforcing the law should be armed with firearms, an armed paramilitary force is not a universal solution, but there still should be armed enforcement.
Regardless of what happens with the police, again, law abiding citizens should have the option to defend themselves, especially since the police have no obligation to: https://en.wikipedia.org/wiki/Warren_v._District_of_Columbia