There is way too much information involved to cover it all in an Avvo post. It would be easy to write an entire book on the subject... and, fortunately, somebody has.
Check out Fight your Ticket, which is published by Nolo Press. It sells for about $25 at most bookstores and online retailers like Amazon.com.
If you read the book carefully, you may find other issues you hadn't even considered.
Please understand that this is a general discussion of legal principles by a California lawyer and does not create an attorney/client relationship. It's impossible to give detailed, accurate advice based on a few sentences on a website (and you shouldn't provide too much specific information about your legal matter on a public forum like Avvo, anyway). You should always seek advice from an attorney licensed in your jurisdiction who can give you an informed opinion after reviewing all of the relevant information.
I agree with Attorney Marshall's answer and would add that the book can also be found at many libraries if you don't wish to purchase.
In the book, look at doing a trial by declaration first, then a trial de novo if you don't win the first one (the book will explain it).
Good luck with your situation.
Having done hundreds of traffic court cases (on the prosecution and defense side), I know that it's very difficult to beat a traffic ticket. If you're charged with speeding, you'll want to know whether the officer measured your speed via radar (or lidar) or via pace. If the officer paced your vehicle, then you may want to determine how long he paced for vehicle (time / distance) and when his speedometer was last calibrated, and then argue that he didn't have the time to pace you properly and/or his own speed cannot be accurately verified. Fighting the case by declaration has certain advantages -- most officers hate paperwork and don't get paid overtime to file written responses, so there's a chance that a trial by declaration may be your best chance. However, the advantages of an in-person trial are that (1) if the officer doesn't show it's a dismissal and (2) if the officer does show, you can usually change your mind about pleading guilty and hopefully get a lower fine OR you can make a case for a lower speed that might qualify you for traffic school, assuming traffic school is an option. If traffic school is an option, I would recommend that alternative to contesting the ticket. Even with reasonable judges, you'll likely have a less than 10% of winning.