During my travels I usually have a habit of seeing, when it's possible, some of these things: markets, libraries, parks, museums and universities. They usually give me a good feel for the city, in the case of universities this is due to several reasons. During my stay in San Francisco I could not miss what is probably the world's best public university, and the rebel university which the US had to answer to. A University of reference throughout the twentieth century, a university where protest movements have emerged such as the anti-Vietnam War, and the hippie movement. It was definitely special, easily reached by public transport, from San Francisco to Berkeley.
If you're in the Bay, take the opportunity to visit an American university. The University of California at Berkeley is easily accessible from San Francisco by train (BART). You may be shocked by the large number of homeless people that you'll see around the campus ... and don't miss the library, or the climb to the top of the Sather Tower. For a few dollars, you can also visit the white tower in the middle of the campus for a nice view of San Francisco and the bay. And of course if you want a branded sweatshirt, the campus has a store for that!