Depends if you like city/nature, coast/mountain.
That time is usually good for SF (Indian summer - though weather always unpredictable), and great for Yosemite (fall leaves, not crowded), okay for coast (though getting a bit late in year, play it ear as to weather).
So, I would:
3 days in SF.
Stay in an interesting hotel downtown. Don't know many (never needed one when I lived there) but I always thought this place was really cool and will stay there on my next business trip to SF (now I've moved away).
http://www.hoteltriton.com/
Lots of tourist books on what to do in SF, but I would include the Castro (colorful gay subculture area - I used to live there and it's interesting even if you're straight), Haight Asbury and nearby Golden Gate Park, DeYoung Art Museum (recently reopened), Sausalito (a ferry ride from SF, have lunch here on a nice day), Berkeley (a subway ride, the UC campus and Telegraph Ave are well worth seeing)
1 day on coast
Go to Point Reyes.
http://www.pointreyes.org/ This is a seashore area about 1 hour north of SF that has great beaches, rolling hills, and interesting little towns.
I would stay at Pelican Inn in Muir Woods, 1/2 mile from Muir Beach
http://www.pelicaninn.com/ old English-style pub/inn, good food and ale, big roaring fireplace, I love it.
Visit Point Reyes Station (this is a little town), some beaches (Stinson is the touristy one, I prefer the more remote ones on the Point Reyes Natinal Seashore.
http://www.nps.gov/pore/planyourvisit/beaches.htm )
2-3 days in Yosemite.
Rent car, drive 4 hours to park
Stay at Awahnee Hotel
http://www.webportal.com/ahwahnee/ classic old National Park landmark hotel.
Or go to opposite end of budget with tent cabins in Curry Village
Walk in meadows, take photographs, dayhike, visit waterfalls (though they'll be running low), just chill out
Now, if you prefer coast to mountain, then I'd skip the Yosemite and spend more time in Point Reyes, also consider going further north to coastal redwood country in Humbolt and Mendocino counties.