It is widely accepted that the teachings on anātman must be set against the background of Brahmanical thought of the day. It is further generally accepted that the texts that have come down to us as the Upaniṣads, especially the Bṛhadāranyaka, Chāndogya, Taittirīya and Aitareya Upaniṣads, reflect the Brahmanical religion at the time. In the the Tevijja Sutta (DN 13) we find references to these four for instance . It is often assumed that the Brahmanical faith formed the mainstream of religion at the time and place, though this is now plausibly disputed (see Rethinking Indian History), and it seems likely that Brahmins and their religion were new comers to the North-east of India, and in fact in the process of absorbing ideas from the samaṇa movements. In any case many people have pointed to passages in the Pāli Canon which show that early Buddhists were familiar with the Upaniṣads - and anatta in relation to ātman is one of the key aspects of this theme.
Just as the central uniting concept across all of the Buddhist texts is paṭicca-samuppāda, the central subject in these early Upaniṣads is the identity of brahman and ātman: the former being the universal essence, while the latter is the manifestation of that universal essence in the individual. As Signe Cohen puts it:
"An Upaniṣad can, most simply, be defined as an ancient text in Sanskrit that teaches that ātman and brahman are one and the same, and that the knowledge of this identity leads to liberation from the cycle of death and rebirth." However at the same time there was a theistic tendency present in the Upaniṣads which gradually became more prominent. In its theistic guise the grammatically neutral brahman becomes the grammatically masculine brahmā, and is equated with Prajāpati 'Lord of Progeny' aka the Creator God. The two terms are often ambiguous: as the first member of a compound they are both brahma-. Additionally the two are sometimes used side by side as if to make it clear that they are not to be considered distinct. As time goes on brahman is used less, and brahmā more.
We know a certain amount about the Buddha's contemporaries from polemics and parodies directed against them in the Pāli texts, though of course such portrayals must be taken with a grain of salt. Jains, Ājivakas and Brahmins are recognisable in the texts from the way they behave and how they speak. However, and this is my main point today: nowhere in the Pāli canon, so far as I can tell, does any Brahmin so much as express an opinion on ātman, and nowhere is the ātman doctrine attributed to a Brahmin. This is a surprising situation since this doctrine is one of the most characteristic and distinctive of that group. A subsidiary point is that while the founders and important teachers of religions are mentioned, Jains for instance talk about former teachers, and while there are even lists of the seven Vedic ṛṣi - the star of the early Upaniṣads - Yajñavalkya - is not mentioned in Pāli.
In Pāli the two Sanskrit words brahman and brahmā have coalesced into the single form brahmā (a masculine noun) which sometimes stands for religious ideals in general (it is often translated as 'holy' or 'divine' for instance), but in our present context always means the creator god.  The coalescence may be reflected in the confusion of the declension of the noun,  and we do not know whether the single, if somewhat variable, grammatical form in Pāli represents the state of Buddhist knowledge of Brahmanical beliefs, or whether a mechanical process of grammatical change obscured a difference (c.f. my comments on sattva, satka, satva in Philological Odds & Ends III sv bodhisattva). Notwithstanding the ambiguity of brahma- as the first member of a compound, in the context of the beliefs put into the mouths of Brahmins (or indeed into the mouth of Brahmā) there is no clear reference to brahman in any text in the Pāli Canon.  I'm not the first to make this observation, but don't have references to hand.
Parodies of the creator god are some of the funniest, and most damning of the Buddhist polemical texts - the creator god is portrayed as a deluded and bombastic fool, afraid to look bad in front of the other gods. The central Brahmanical idea of the identity of brahman and ātman is completely absent and has been replaced by the idea of brahmasahavyata - companionship or union with Brahmā. The word brahmavihara 'dwelling with Brahmā' is a synonym of this. However note that I have summarised Gombrich's discovery that the Buddhist texts seem to have lost the true sense of this allusion before the fixing of the Canon - The Buddha and the Lost Metaphor.
The clear references to Vedic texts noted by Gombrich and others (including me) have established that the Pāli texts themselves are aware of Vedic concepts. We find the names of Vedic ṛṣi, and Vedic traditions; references to sacrifices, sacred fires, mantras (in particular the Sāvitṛ mantra); references to sacred bathing, to worship of the sun. We find a high awareness of Brahmanical class (vaṇṇa) prejudice. We also find more oblique references to the five fire wisdom, and to Vedic cosmogony (especially as found in the BU and Ṛgveda 10.90). Many of these ideas and practices are still current in India more than 2000 years later! Although sometimes Brahmins are clearly just straw-men and present an inauthentic façade to be knocked down, there are many texts were Brahmins are recognisable even if not labelled as such. What's more the texts themselves record that many Brahmins of various kinds became converts (including prominent disciples like Sāriputta and Moggallana!) so the compilers of the texts had plenty of opportunity to mix with actual Brahmins. We have evidence of increasing Brahmin participation and influence in the Buddhist Sangha - some of which I discussed in A Pāli Pun. The text which most often seems to referenced is the Bṛhadāranyka Upaniṣad (BU). Those scholars who have tried to determine the geographical locations of the various texts (primarily Michael Witzel) place the BU in the eastern areas of North India in the Kingdoms of Kosala and Vidheha - precisely where the Buddha was active.
A conflicting picture emerges for which I have as yet no explanation. Brahmins in the Pāli texts are either old school Brahmins focussed on the sacrifice, or they are outright monotheists which is usually considered to be a late development - associated with later Upaniṣads or even the Puraṇas. A possibility is that the jaṭila or dreadlocked ascetics (especially Uruvela Kassapa) were ascetic Brahmins - the commentarial tradition certainly considers them Brahmins, though the nikāyas are more ambiguous. They are fire worshippers, some of them show allegiance to Brahmins (c.f. Sela Sutta) and have Brahmin surnames like Kassapa. But what beliefs they espoused is not revealed to us.
The Pāli texts appear conversant with aspects of the Upaniṣads, especially those related to cosmogony; and to Brahmin culture more generally, particularly concern for social class and stratification; and ritual purity. Certainly the subjects of atta and anatta get considerable attention, but they are never linked to the source i.e. the Brahmins themselves. Although we can easily make the cognitive link between a teaching against ātman and a group which we know espoused views on ātman, in practice the Pāli texts never seem to make this link! Indeed the important point about ātman from the Brahmanical point of view is not its eternal nature, i.e. not the fact that it participates unchanged in rebirth per se which is the focus for Buddhists, but its identity with brahman, since it is this identity that allows one to escape saṃsara (with more space I would discuss the proposition that this was by no means universally accepted by Brahmins in the Buddha's day). In short early Buddhists, perhaps the Buddha, but certainly the Early Buddhist texts, seem to have missed the main point of the Upaniṣads. The apparent fact of increasing Brahmanical influence in Buddhism makes this even more difficult to understand. Ironically centuries later they adopted more or less the same idea in the form of the Tathāgatagarbha for precisely the same reasons the Brahmins adopted it - it explains how liberation is possible for someone mired in saṃsara. There are also echoes in such ideas as absolute and relative bodhicitta.
Contra my previous enthusiasm for this idea, I think, therefore, that we must be cautious in accepting the conjecture that Early Buddhists were conversant with the traditions represented by the Upaniṣads. My suspicion is that the teachings on anātman/anatta do not relate directly to the ideas on ātman found in the Upaniṣads; that this is simply a coincidence of terminology, rather than a coincidence of ideology, however this would require a major rethink about the relationship between Buddhism and Vedism. Another possibility is that Buddhists only came into contact with Brahmins at a much later date than we usually allow for. Alternatively the Brahmins in the Canon, especially those who joined the bhikkhu saṅgha, might not have accepted the Upaniṣads - perhaps they moved eastwards for the same reasons that people fled Europe for America in the 17th century.
We must do more work to establish the extent of that Buddhist conversance with Brahmanical thought. Ideally we would go back over the research on ātman in Buddhist texts to date, and try to determine if it does in fact relate to Brahmanical views at all, or whether we need to look to another source.
- DN13 records various types of Brahmins: addhariya, tittiriya, chandoka, chandāva and bavhārijjhā or brahmacāriya (the ms. disagree on the last, but there is a lost Brāhmaṇa text called Bahvṛca which would coincide with Pāli bavhārijjha). The chandāva brāhmaṇas are left out of some mss. and the connections are uncertain. Tittiriya and Chandoka correspond to Sanskrit Taittirīya and Chāndogya and to the Brāhmaṇa and Upaniṣad textual traditions of the same name. Although the Bahvṛca Brāhmaṇa is lost it is linked to the Aitareya Upaniṣad. Lastly addhariya corresponds to Sanskrit adhvaryu and is associated with the Śatapatha Brāhmaṇa and the Bṛhadāranyaka Upaniṣad. These correspondences are discussed in the notes to Rhys Davids translation of the Dīgha Nikāya (p.303, n.2) and in Jayatilleke Early Buddhist Theory of Knowledge, p.479f.
- Cohen, Signe. Text and Authority in The Older Upaniṣads. Leiden: Brill, 2008. p.39.
- A cursory look at the Mahāvastu suggests that it also only uses brahmā and not brahman, or uses brahma- as the first part of a karmadhāraya compound (i.e. as an adjective). The vast majority of uses are in the compounds brahmacariya and brahmacārin. Along with the name King Brahmadatta these account for perhaps 90% of occurrences in the Sanskrit text.
- The Pāli treatment of Sanskrit nouns ending in consonants is inconsistent. Our word brahmā sometimes follows the masculine -a declension, sometimes the -u declension; with other minor variations such as a vocative singular brahme and plural brahmāno perhaps drawing on the feminine -ā declension. Other -n nouns such as rājan, and attan show similar variability.
- I have sought to identify all nikāya texts where a Brahmin makes a profession of belief. They are:
- DN 3, 4, 5, 6, 9, 10, 11, 12, 13, 27.
- MN 49, 50, 84, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 108.
- SN 6.3, 4; 7.1, 6, 7, 8, 9, 10, 11, 14, 17, 18, 19, 20, 21, 22; 35.132, 146, 151; 42.6; 45.38; 55.12.
- AN 3.54, 56, 58, 59, 60; 4.23, 185; 5.191, 192, 193; 6.38; 7.62; 10.119, 167, 168, 176, 177.
- Sn 1.7, 8; 2.7; 3.4, 6, 7, 9.
- DN 3, 4, 5, 6, 9, 10, 11, 12, 13, 27.