He wrote several books among them the Decisive Treatise on the Agreement Between Religious Law and Philosophy, Examination of the Methods of Proof Concerning the Doctrines of Religion, and The Incoherence of the Incoherence. His position in life was that of chief judge who worked under the Almohads, one of the strictest Islamic regimes in the middle ages. They were slowly becoming less rigid, but not at the speed that Averroes was learning/teaching.
Averroes had no issues dismissing or changing some Muslim tenet beliefs if it didn't fit his philosophy though. For instance, the Muslim belief in the resurrection of the dead, he says we must believe in personal immortality but we don't really have souls it's just our shared intellect that survives. And our bodies die.. no one really survives forever.
He lived in a time when most Muslims believed that philosophy was not a legitimate form of study. He ended up exiled (with his books banned) from his homeland for two years because popular opinion was against him.