There isn’t much information regarding taking the train from Beijing to the Great Wall (by Gubeikou village 古北口), but I am here to report it can definitely be done and done cheaply. If you would like more information about the sections of the wall near Gubeikou, there is a fair amount of information here on the Great Wall Forum.
As for getting the train, you’ll want to ask for a ticket to Luishuigou 流水沟 on the train 4471 (the incredibly slow train between Beijing and Chengde). The ticket sellers most likely will have no idea what you are asking for so be sure to tell them the train number and also consider writing down the stop in Chinese, even if you speak Chinese well. The ticket costs 12 rmb, leaves from Beijing North (Xizhimen on subway lines 2, 4 and 13). The train is indeed very slow, taking about 5 hours to go the 145 km to get to Gubeikou. On the plus side, there are very few passengers and the scenery is nice. Though buying a ticket directly to Gubeikou currently isn’t possible, the train will stop there. It is the station right before Luishuigou. Make sure to let the train workers know where you want to get off and they will alert you when the train arrives. Our hostel, Great Wall Box, arranged a driver to pick us up from the station. It was 20 rmb for the van and worth it as I didn’t see much around the station. You might have to look around a bit and negotiate for a driver if you don’t arrange pick-up.
As for places to stay, the Great Wall Box is one option. Their prices are high (150 rmb for a dorm bed 1500 for a private room), but the setting and hostel are beautiful. They can be booked on hostelworld. There is also a very cheap Chinese guesthouse I found in the village that is friendly and has good food. The price is about 120 rmb for a room with a bathroom, though other options are available. The don’t speak English. The phone number is 010-81051469 and mobile is 15910427153. The address in Chinese is: 古北口隧洞前下车售票处往前10米。
You can access part of the Great Wall for free from Gubeikou, though at some parts you’ll have to pay admission (25 rmb).
Getting back to Beijing can be done by taking the bus to Miyun and then switching for another bus to Dongzhimen. Otherwise getting back by the slow train is possible. It leaves just after noon and arrives at Beijing North at 4:30 pm. If you want to head north to Chengde take the 4471 train leaving at just after 2pm which will arrive in Chengde at about 7 o’clock in the evening.