To make things confusing, the word for the immortal essence of a person in Vedic thought is 'atta' and the word for a conventional individuality is also 'atta'. For most of Buddha's contemporaries the sense of self was the experience of an immortal Atta. Buddha challenged this idea, teaching people to look at their experience more deeply.
The Buddha emphasised not speculation about things as they are outside of human experience (ontology, metaphysics), but the nature of phenomena as they are experienced or can be experienced. He was in that sense pragmatic and empirical. This is why he tended to always speak in reference to something - phenomena, the aggregates, or the world (the set of aggregates, everything that can be experienced). This was not just a special qualifier for the doctrine of Anatta, but the way he always spoke (AFAIK). This applies equally to Impermanence and Unsatisfactoriness too. Speaking this way turns our attention to actual observation as opposed to abstract speculation.
Buddha realised that we suffer because we cling to phenomena - we identify with them, and we appropriate or identify them as ours. Not only that, but we do not see clearly that we are doing this, instead holding self-views. We construct a concept of our self and we conceive our experience in terms of that as if it was a real entity - that we are the phenomena, that we are in the phenomena, that the phenomena are in us, that phenomena are possessed by us etc. The Buddha wants us to see this and thereby relinquish our clinging identifications. To do this we must abandon self beliefs and self-views and see the nature of phenomena clearly.
It is repeated many times through the suttas that no atta is to be found anywhere in our experience.
"Insofar as it is empty of a self or of anything pertaining to a self: Thus it is said, Ananda, that the world is empty. And what is empty of a self or of anything pertaining to a self? The eye is empty of a self or of anything pertaining to a self. Forms... Eye-consciousness... Eye-contact is empty of a self or of anything pertaining to a self.
"The ear is empty...
"The nose is empty...
"The tongue is empty...
"The body is empty...
"The intellect is empty of a self or of anything pertaining to a self. Ideas... Intellect-consciousness... Intellect-contact is empty of a self or of anything pertaining to a self. Thus it is said that the world is empty."
However Buddha is happy to use 'atta' in it's conventional usage to mean 'oneself' as opposed to 'him' or 'her'. One who is liberated does not experience in terms of, or in reference to, a self at all. He or she does not hold onto a belief that 'there is no self'. However he or she can still make use of such terms as conventions of language.
On the other hand, taking up a belief or position about it such as 'there is no self' may be unhelpful as this is abstraction, not observation and potentially leading to the view that 'my self does not exist', 'I have lost the self that I formerly had', which is not liberation, but suffering based on clinging identification to that which one feels has been lost. This explains the single occasion (AFAIK) when the Buddha refused to answer whether there was a self or not. The question was asked in abstract terms, not in reference to phenomena.
"Ananda, if I — being asked by Vacchagotta the wanderer if there is a self — were to answer that there is a self, that would be conforming with those priests & contemplatives who are exponents of eternalism [the view that there is an eternal, unchanging soul]. If I — being asked by Vacchagotta the wanderer if there is no self — were to answer that there is no self, that would be conforming with those priests & contemplatives who are exponents of annihilationism [the view that death is the annihilation of consciousness]. If I — being asked by Vacchagotta the wanderer if there is a self — were to answer that there is a self, would that be in keeping with the arising of knowledge that all phenomena are not-self?"
"And if I — being asked by Vacchagotta the wanderer if there is no self — were to answer that there is no self, the bewildered Vacchagotta would become even more bewildered: 'Does the self I used to have now not exist?'"