Firearm cost is dependent on gun (its like asking how much does a car cost) having said that if your looking for a handgun, which sounds like what you would need for close quarter personal protection and possible carry. You would be looking at $500- 1000 average.
.Dont live in CA, so can not help.
As far as training goes: Spend as much as you can afford on GOOD training. Expect to spend $500 $1000 min, for multiple days training with a professional instructor. RESEARCH your instructor. Tactical and Advanced Defensive courses are effectively teaching a person to use firearms or other weapons to defend yourself and possibly others, so this should not be compared with any of the shooting sports. Tactical shooting and sport shooting are NOT the same. Sport shooting is a great training aid for speed sighting and trigger control; it is not a substitute for real training.
Good training is key to winning all fights, including gun fights. Obviously time, money and location / travel are key to what classes you take. Get as much training as you can, from as many instructional facilities as you can. Walk into each class with an open mind
..and be wary if the instructor or facility that is more focused on telling you how great they are, than teaching you how to improve your skills. You are paying for your time with the instructor
be careful of the instructors that just want to spend most of YOUR time and money telling you about his or her war stories...Buy a book, its cheaper!