Do native speakers learn about 4 tones in school or do they naturally pick them up without formal education? Do native speakers explicitly learn about 4 tones in school or do they naturally pick them up without formal education? If so how does the school test it? By having students write appropriate tone marks on words? Or do they have oral tests?
I think there are two different ways to read the first part of your question:

1. Do children learn how to say words with the appropriate tones prior to going to school?

2. Are children explicitly aware of the tones they're using. (e.g., When they say 中国, do they know or could they explain that 中 is zhong1 and 国 is guo2)?

The answer to #1 is (obviously!) yes.  It's their native language, so of course they pronounce it (more or less) correctly, and that includes the tones.  The answer to #2 is mostly no, and instruction in school builds that explicit knowledge.  

To make an analogy to English speakers, consider stressed and unstressed syllables.  Children who are native speakers of English correctly stress different syllables of multi-syllable words.  In "computer" they will stress the 2nd syllable, and in "telephone" they will stress the 1st.  But if I were to ask my 4-year-old son "Which syllable is stressed in the word 'computer'?" he wouldn't be able to tell me. When he gets older and begins to understand syllables and patterns of stress in English, he will gain that explicit knowledge. (Though as Gangosa notes in his/her answer, you can speak English just fine without it.)

One additional point: As EmmaXL states in her answer: "Pinyin is to assist students to learn Chinese." More specifically on the mainland, explicit knowledge of pinyin helps students' Chinese move closer to standard Putonghua. With such major differences between dialects of Chinese, this explicit instruction is necessary to get everybody speaking (mostly) the same language.