Teach Your Children was written by Graham Nash for his band, The Hollies.
The Hollies never got around to recording it and so he brought the song to his next band, Crosby, Stills and Nash. The trio recorded the song but when it was released in 1970, the band had added Neil Young so the album was CSNY's "Deja Vu," but Young doesn't play on the song.
In fact, here's a nice version by Crosby Nash (no Stills or Young):
From the liner notes of their 1991 boxed set, Nash writes:
The idea is that you write something so personal that every single person on the planet can relate to it. Once it's there on vinyl it unfolds, outwards, so that it applies to almost any situation.
Clearly, the song had autobiographical meanings for him. I didn't find anything specifically about the song, but in this 1974 Rolling Stone interview, Nash talks about his father. The elder Nash bought a camera from a friend. The police showed up and claimed the camera was stolen property and demanded Nash's father to reveal who had sold it to him; when he refused, he was sent to prison for a year. Nash claims the episode so shamed his father, it essentially caused his death.
Somewhat ironically, given the significance of a camera in his father's demise, Nash is a proficient photographer, as well as a collector of photographs. The first photograph he bought was Diane Arbus' "Child with a toy hand grenade in Central Park, NYC 1962"; as he explained in a 2006 interview with the San Diego Union-Tribune, he had just recorded Teach Your Children and the sight of a boy with toy weapons seemed to encapsulate what he was trying to say with his song.
He eventually collected so many photographs, he hired a curator and in 1990 sold the collection at auction at Sotheby’s.
Nash goes on in those 1991 liner notes:
The country beat helps, but so does that pedal steel guitar. That’s not any of the band members, but instead a friend who traded his time in exchange for harmony lessons for him and his bandmates. The friend? Jerry Garcia of the Grateful Dead.
If you want to know what Garcia was playing, you can see it here:
What? You missed it? This video teaches you exactly what to play, (although I have no idea what he’s talking about).
(Crappy) audio only of the second season episode of The Office “Take Your Daughters to Work Day” featuring Dwight and Michael singing Teach Your Children:
Here’s a listenable version featuring Kathy Mattea and Suzy Bogguss on vocals at the Grand Ole Opry (Mattea and Bogguss recorded the song with Nash as The Red Hots for the charity album “Red, Hot and Country”):