Welcome to FlyerTalk [MENTION=10054052]Kahlia1406[/MENTION]!
I merged your question into the relevant thread.
Yes, you will have to go through immigration and customs before proceeding to your next flight.
Three hours should be sufficient, however, if your flight from Mexico is late, you may not be protected on your flight to Australia if your booked them separately on different tickets.
Please take a look at the wikipost which appears at the top of every page in this thread for additional information.