Family Law Questions? Ask a Family Lawyer Online.
There really aren't any precautions to take. Just realize that if you change your mind, it is very difficult to change your child's name and you need the consent of the other parent to do so. If you ever think that you might not want your child to have his father's last name, then I would not give him that last name. On the other hand, if you intend on marrying the father, it make sense.
If you will not be marrying the father, you may also want to start a court case to outline when the father will see his child and how much child support he will pay. California has a very good self help system where you can find the forms and instructions to do this if you want. http://www.courts.ca.gov/selfhelp-custody.htm