Frankly speaking, who cares if it's illegal at this point?! You and your child should not be exposed to this environment.
As many others have mentioned, call the SF Rent Board immediately to try to get some answers on how to proceed. As Realtor/agents, we are not allowed to give legal advice so seek the help of a professional right away.
I wish you well with the unfortunate situation.
I am very saddened to hear about your plight with these issues. I recommend checking out the below webite for help/advise.
The San Francisco Rent Board
25 Van Ness Ave., Suite 320 Monday - Friday excluding holidays
San Francisco, CA 94102-6033 Phone: 415-252-4602
(Cross street is Market Street) Fax: 415-252-4699
You may also want to consult with someone that can offer you legal guidance.
Good luck to you.