BtD
There is this:
It's near the BART (if you are flying in to SFO or Oakland) and is not too far from Union Square. It's in a slightly seedier area, but 2 blocks over, it's Union Square and much nicer. SF is like that as Alex pointed out, one block is scary, the next gentrified (or at least colorful). About $90 a night, depending on the room. Not sure how inexpensive you mean. For SF, this is cheap, I'd say.
http://www.hotelmetropolis.com/
Anyway, from here you can catch MUNI, BART and a Cable Car or cab and get around town.
it's an option