We learn indeed from certain passages of the Veda ([R.]ig-veda II. 12. 5; VIII. 100. 3, 4) that even in the Vedic age some denied the existence of the god Indra.
We know, too, that Yaska, the well-known Vedic commentator, who is believed to have lived before the grammarian Pa[n.]ini (probably in the fourth century B.C.), found himself obliged to refute the sceptical arguments of Kautsa and others who pronounced the Veda a tissue of nonsense (Nirukta I. 15, 16).
Again, Manu--whose law-book, according to Dr. Bühler, was composed between the second century B.C. and the second A.D., and, in my opinion, possibly earlier--has the following remark directed against sceptics:--
'The twice-born man who depending on rationalistic treatises (hetu-[.s]astra) contemns the two roots of law ([.s]ruti and sm[r.]iti), is to be excommunicated (vahish-karya[h.]) by the righteous as an atheist (nastika) and despiser of the Veda' (Manu II. 11).
Furthermore, the Maha-bharata, a poem which contains many ancient legends quite as ancient as those of early Buddhism, relates ([.S]anti-parvan 1410, etc.) the story of the infidel [S']arvaka, who in the disguise of a mendicant Brahman uttered sentiments dangerously heretical.
This [S']arvaka was the supposed founder of a materialistic school of thought called Lokayata. Rejecting all instruments of knowledge (prama[n.]a) except perception by the senses (pratyaksha), he affirmed that the soul did not exist separately from the body, and that all the phenomena of the world were spontaneously produced.
The following abbreviation of a passage in the Sarva-dar[.s]ana-sa[.n]graha[6] will give some idea of this school's infidel doctrines, the very name of which (Lokayata, 'generally current in the world') is an evidence of the popularity they enjoyed:--
No heaven exists, no final liberation, No soul, no other world, no rites of caste, No recompense for acts; let life be spent, In merriment[7]; let a man borrow money And live at ease and feast on melted butter. How can this body when reduced to dust Revisit earth? and if a ghost can pass To other worlds, why does not strong affection For those he leaves behind attract him back? Oblations, funeral rites, and sacrifices Are a mere means of livelihood devised By sacerdotal cunning--nothing more. The three composers of the triple Veda Were rogues, or evil spirits, or buffoons. The recitation of mysterious words And jabber of the priests is simple nonsense.