I didn't mention basketball before (SF is more of a baseball town), but the Warriors play in Oakland (across the bay). You can take BART to get there. Unfortunately Aug-Sept is not basketball season, it is baseball season. If you come another time of year you can get tickets on StubHub. I see tickets on there now for as low as $2. http://www.stubhub.com/golden-state-warriors-tickets/
There are public basketball courts if you want to shoot hoops yourself. You can probably find one near where you are staying/working: http://sfrecpark.org/wp-content/uploads/Basketball.pdf