San Jose, Calif., which calls itself the capital of Silicon Valley and has grown to become the nation’s 10th biggest city, has had to shed more than a fifth of its workers in recent years to save money. It is, in a way, a microcosm of the nation, which has lost 668,000 state and local government jobs since the recession hit — making it harder to provide services and upending the lives of thousands of people who have lost their jobs.