Final answer:
Mahatma Gandhi established his law office in Johannesburg, South Africa, where he served the Indian community and developed his nonviolent resistance techniques.
Step-by-step explanation:
Mahatma Gandhi set up his law office in South Africa in Johannesburg to fight cases for the local Indians. After completing his education in law in England, Gandhi went to South Africa, where he lived for twenty-five years, serving the Indian community there. He reacted to racial discrimination by beginning to organize on behalf of non-whites. His experience in South Africa was crucial, as it shaped his methods of peaceful civil disobedience that he would later use effectively in the Indian independence movement.