The California Coastal Trail (Golden Gate National Recreation Area, 10.5 miles, difficult) runs right through the city of San Francisco  on its way down the state. Originating beneath the Golden Gate Bridge , the Coastal Trail meanders all the way down the west side of the City. It passes by many major monuments and parks, so you can take a break from hiking to visit Fort Point, the Palace of the Legion of Honor , and the site of the Sutro Baths.
You’ll get to walk right along the famous beaches of San Francisco  as well, from Baker Beach  to China Beach and on down to Ocean Beach , which comprises five miles of the Coastal Trail. You can keep on walking all the way down to Fort Funston, and the San Francisco portion of the trail terminates at Philip Burton Memorial State Beach.
You can enter the trail from just about any place, and exit wherever feels convenient. Just be sure you’ve got a current trail map to be sure you’re aware of any partial trail closures.