Carriers will become obsolete when their cost/benefit ratio drops in favor of something better. As of now, carriers are, by far, the most expensive warship in the US Navy. In fact, you can operate four Iowa class battleships for less than it cost to operate one Nimitz class carrier. On top of that, they operate in battle groups, so the true operating cost must incorporate the Aegis cruisers, submarines, destroyers, and resupply ships that go with it. With that said, they pack an enormous amount of firepower and have a tremendous amount of versatility, both in war, preventing war, and peacetime operations for what they can do. The US Navy's amphibious warfare fleet, all 10 in total, do a fantastic job of fulfilling the role of humanitarian missions, but true supercarriers are much superior with the level of air dominance they can achieve.
I don't see supercarriers being replaced, but only evolving into more drone oriented ships, and with a lot more drone craft. Think something like a swarm ship, but it will be difficult to replace true pilots. Additionally, I think we will see long range, high power rail gun technology begin to supplement the strike capabilities of aircraft. Still, there will always be a need to have eyes closer to the ground that aircraft will provide over long range run guns. Due to the incredible destructive power of today's weaponry, we probably will never see the likes of true, ultra heavy armored battleships. Instead, this heavy firepower will be spread out across more ships, with more emphasis on active defense systems and stealth technology. This is really no different than it is today.
The only real limiting factor to this so far is the power generation systems within today's naval warships. Rail guns will supplant standard artillery at some point; it's only a matter of time (~10+ years). Only the Zumwalts and the carriers have the power generation capabilities to power rail guns though, but that will change over time. We'll probably see the Arleigh Burke class have electric drives added, and as new warships come online, they will be built to incorporate the power hungry weapon systems of today's Navy.
As for bringing back battleships, it's never going to happen. The battleships are unsurpassed in their role at delivering large quantities of heavy ordinance to within 20 miles of the coastline. No warships can do it more cheaply than a battleship for poundage of ordinance. But this is all they're good at, and despite the drastically higher operating cost, carriers can fulfill many, many more roles for the dollar, and do the job like that of a battleship. The only role for the battleship nowadays is to refurbish them into high power, long range surface combatants, but it's too late for that now. The Zumwalts are already built, and require a lot less manpower to operate.