Productions of the form A-> A are removed immediately, but what if the production is of the form A -> AA? example: A -> AA | a
Removing identical variables in CFG Unit Productions
formal languages;context free
In you example the production A->AA can not be removed. If that production is removed then the language described by the grammar will change. But in case of a production like A->A, the removal will not affect the language described by the Grammar.