When Miss Caroline realizes that Scout can read, she tells her to inform Atticus that he is to stop teaching her, and leave that to Miss Caroline. Scout thinks,
"I never deliberately learned to read, but somehow I had been wallowing illicitly in the daily papers" (pg 17)
The fact of the matter is that Atticus shared special time with Scout every evening and read the newspaper to her. Scout was an intelligent girl and as Atticus's "moving finger" ran across the words, she stared at them and figured out what the words meant. When Scout decides she doesn't want to go to school because she is not supposed to know how to read, Atticus makes an agreement with her that if she agrees to go to school, he will continue their nightly reading sessions. She agrees, but Atticus tells her not to tell Miss Caroline because Miss Caroline would then get after Atticus, and he doesn't want that.
Scout's ability to write is a little different. Scout says,
"Calpurnia was to blame for this" (pg 18)
When Scout was driving Calpurina crazy on rainy days, Calpurina would write the alphabet on the top of a tablet and have Scout copy it. Then she would write a Bible chapter, and if Scout copied it to her satisfaction, she would reward her with bread, butter, and sugar. However, Scout, herself, says she seldom got rewarded.
Scout "accidentally" learns to read by spending time with her father in the evenings. On these nights, she would sit in Atticus's lap and listen to him read out loud from the newspaper, watching while his finger traces under the printed lines. Staring at the words helps her to begin to distinguish one from another.
This becomes an issue on Scout's first day of first grade, when Miss Caroline discovers that Scout can indeed read. She makes the assumption that Atticus has taught his daughter this skill and feels disturbed that a man would take it upon himself to do so without being educated in the pedagogical theories of John Dewey, insisting that "reading should begin with a fresh mind." Scout gets a firm scolding from Miss Caroline, who is clearly new to teaching.