Parking is a pain in San Francisco even for those of us who live here. Keep this in mind when you're deciding whether or not you should rent a car. Parking is very expensive --$50/day at most of the hotels in the area, potentially more for an oversized vehicle. There are "motor inns" that you can stay at along Lombard street (not in the area as the crooked section) but I generally don't recommend those. Most are extremely overpriced for what you get, even if parking is included. Some people consider doing street parking, however, I don't really recommend this. Many streets require you to have a residential sticker. If you don't, they will tow or ticket you. There may also be time limits on how long you can park, etc... Simply put, if you plan to stay in SF, visit attractions in SF, etc... don't rent a car. It isn't needed. Walking, Muni and possibly taxis will serve you just fine. If you're dead set on driving and you're staying in the Union Square area, you may consider this off site garage for $30/day: http://www.fifthandmission.com/about.htm This may or may not be great depending on how many blocks away your hotel is but I thought I would mention it anyway.
If you wish to do a day trip, there are many rental car agencies in the downtown area as well as at Fisherman's Wharf. It is often cheaper to just rent a car for the day, take your trip and return the car when you are done.