In CA, the LL has to give you notice in writing of your right to a move-out inspection. The law is very specific. This law is designed to give tenants the opportunity to get all of their deposit back. If the LL didn't do this, you automatically get your full deposit back.
I think the easiest and cheapest thing to do is to sue the landlord in small claims court, in my opinion. The LL can then tell the collection agency the debt has been satisfied. Let the landlord deal with the collection agency.
This all assumes that you have not been sued and lost by your LL. If you were sued and didn't show up, you lose, and you will have to make a deal with the collection agency.
If your landlord just sent a bill to collections without first getting a judgment, then I think you should sue.
I think you should start with a letter to the LL, though, as you first need to demand your money back, before going to court. Something along these lines:
Dear Landlord,
I have received notification that you sent a bill to a collection agency regarding money I supposedly owe you. In short, because you did not follow California tenant law regarding my right to a move-out inspection, even after I specifically asked for a walk-through, you forfeited your right to any damages. Please refund my security deposit in full in the amount of $_______________ by _________________(x date), and notify the collection agency that this debt was placed in collection in error by same date, and forward a copy of the letter to me with my security deposit refund.
As you know, this property was infested with rats, which I notified you of, and as I was very pregnant at the time, this posed significant health risks.
If I do not receive the deposit refund and letter to the collection agency by the above date, I intend to sue you to the full extent of the law for money withheld in bad faith, as well as for rent paid while the unit was uninhabitable, and any punitive damages the court deems appropriate.
Sincerely,
You
Your Address
The letter alone may do it. If not, file in small claims court and take your chances. Here's CA law:
California Tenants - California Department of Consumer Affairs
Scroll down to the blue section to read about the laws regarding the pre-move-out inspection laws. You can also get help through this website, if you want some legal advice.
Another option for lawyers/legal advice:
Lawyer Referral Services (LRS)