At the top with the longest play time, and joint highest score achieved I think it’s safe to say I like the Pyro.
Quick and nimble, it’s only really the Scout who can confuse him, and any Scout close enough to do that is as good as toast. The Pyros main skill is setting people on fire, this is both disorienting and damaging to the ignitee. As a bonus, if the Pyro is set on fire, it only lasts a second or two compared to the other classes. The flame-thrower does a lot of damage even if you discount the long term effects and it doesn’t require reloading. The Pyro’s main weaknesses are range and low health. The shotgun and flaregun go someway to negating the range problem, but they are no match for the main weapons of other classes.
Pyro vs.

Scout
Once a Scout is set on fire there isn’t much left to do, the difficulty is igniting one in the first place. At long range you either need to switch to the shotgun (the flaregun is slow, but if you’re a good shot it’s worth a go) or leave him, since you stand very little chance of catching up. If you’re well practised then once one gets up close it shouldn’t be too difficult to get a hit with the flame-thrower, if you’re not then just keep moving the flame around. The Scout moves so around so much that it’s bound to connect at some point, and all you need is one hit.

Soldier
A common tactic amongst inexperienced players is to use the airblast against the Soldiers rockets, don’t bother unless you’re very well practised. Due to lag and other variables it’s not easy to reflect rockets well, you’re better off just avoiding them as the Pyro is very nimble. Although if you’re up close and think the next rocket might finish you it’s worth a try. Soldiers are one of the best classes against the Pyro. They have a large amount of health so they survive for quite a while even when on fire. Their rockets have a blast radius, so they don’t have to get a direct hit, which nullifies your speed advantage once things get intimate. At long range (e.g. on either side of the bridge on 2Fort) the flaregun and the shotgun work well due to the slow speed of the Soldiers rockets. You can hang around that range reasonably well without risking going up close. If you are at close range try circling the Soldier, keep moving unless you see he’s run out of all four rockets, in which case move in for the kill.

Demoman
Another good class against the Pyro. Apart from traps, only skilled players pose a threat, but what a threat. Skilled Demomen often switch to their sticky launcher once you get close, back-pedalling and laying down stickies in your path. What happens next, if you keep going, is mostly down to luck. Either switch to using the airblast in the hopes of reflecting a sticky at the right moment or just vary your movement in order to keep him off balance. Traps pose a big threat to any class, so you should always be keeping a look out. However the Pyro has one big advantage over the other classes, the airblast. This is the best weapon against sticky traps (although the update that allowed bullets to destroy them is a close second), providing you spot them of course. If you have the backburner try to find out where the Demoman is hiding and watch for a window of opportunity. Either that or find another route.

Heavy
When going one-on-one against a Heavy, do not stand still unless you are directly behind him. The Heavy’s mini-gun is more powerful than the Pyro’s flame-thrower at point blank range. Similar strategy to the Soldier, circling the Heavy, is a good tactic. Try not to attack one out in the open, somewhere with cover and a place to run is best. If you start taking too much damage, retreat is the best option, if you’ve ignited him then there is still a chance he will fall. Avoid the ones being healed by Medics, unless you get the Medic out of the way you don’t stand a chance except if you get lucky and the flame-thrower crits. What with the Heavy’s enormous health to start with, him being healed and probably overhealed at the start, it would just take too long.

Engineer
There isn’t much to say about going up against an Engineer, since the only real threat comes from his sentry. (see below) I would just say, don’t ignore him completely. The shotgun pack quite a punch, especially when it crits. Catch any when you can since it will make dealing with any sentries you meet later on easier.

Medic
When dealing with a Medic healing another player, go for the Medic. Most classes can survive quite a while against the flame-throwers damage when being healed. Plus even if you die before moving onto the healee you have made it much easier for your team-mates behind you. If the Medic is on his own, like the Engineer, he shouldn’t be much trouble. Watch out for the blutsaugher, if it gets enough hits it can significantly reduce the amount of damage you are doing to the Medic, just veer from side to side, the needle guns aren’t good at tracking. Also beware of something I have experienced quite a lot lately, suicidal, ubersaw wielding Medics, they can finish you off very quickly.

Sniper
Once you’ve got close enough, you’ve most likely got him. Getting close is the hard part. Like any class the Pyro is an easy target for the Sniper at long range, I have occasionally fired the shotgun hoping to distract one, but it’s not very effective and the flaregun is only good if they are not aiming for you. Getting to know your maps is the biggest help in this situation, knowing where good cover can be found and which alternate routes keep you clear. Once you get to the Sniper, watch out, as some like to switch to their kukri when someone gets close. Just move to the outer reaches of your flamethrower if so.

Spy
I don’t think I need to say much here. Give any suspicious allies a quick blast, occasionally fire around at random and into corners. Once you set one on fire it’s easy to tell where they go, switch to the shotgun if they get out of range of your flame-thrower.

Pyro vs. Pyro
Pyro vs. Pyro = shottie. Switching to the shotgun at the right moment is the best way to take down an enemy Pyro. Once you get close enough for the flame-thrower it just comes down to luck. There are a few tips you can use to increase your chances. Firstly is been well practised with the flame-thrower. It has a damage cone and knowing how to direct it to get maximum contact is critical. The second tip is to back-pedal, most of the time the other Pyro will keep coming. When you are running the flame moves relative to your direction, this results in a shorter flame when going forwards, and a longer flame going backwards. By back-pedalling you are changing the distance between the opposing blasts meaning that hopefully you take less damage than you are doing. The flaregun is next to useless, unless the Pyro is already low on health, the small amount of damage the flaregun does will not be enough to have an appreciable effect. It’s main strength (igniting people at a distance) being ineffective against Pyros. The backburner does have a slight advantage, due to the luck of positioning and occasionally incorrect hit-detection. I still prefer to have the airblast, it can be useful if you are running low on health and you are in a position to push the enemy Pyro away. But then you know my feelings about the airblast.
A Word on Sentries
Providing there is some cover for the approach, a Pyro can take out a level 1 sentry single-handed. Levels 2 and 3 are not nearly as easy. One way to take them out is if the Engineer has placed a dispenser too close. If you can survive the initial damage done getting into position, you can hide behind the dispenser. Then attack the dispenser with the flame-thrower keeping in line with the sentry, it still does damage to the it and the Engineer if he’s there. By the time the dispenser is destroyed it only takes a little more damage to take the sentry down. I have also taken down a Level 3 sentry due to poor placement and a large amount of luck.
It was in the entrance of the enemy base on 2Fort, the Engineer had placed the sentry too far back so that it was easy to approach. I charged in, some how missed the rockets, then proceeded to circle strafe the sentry up close. It couldn’t turn fast enough to keep a constant stream focused on me. I proceeded to destroy it, a dispenser and the Engineer guarding them.
The flamethrower is all about angles. If you can get into a good position you can take out a sentry without entering their line of fire.

If there is a wall with a sentry placed in line with it then you can easily take it out by staying close to the wall.
Playstyle
People mostly call the Pyro an ambush class. He can most certainly be played that way. But for me, the most satisfying playstyle is suicidal.
Not the way idiotic players are, charging in without a care for the finer points of the game. The suicidal Pyro is the most noble character. Sacrificing himself for the good of the team, with no care for scoring points (although kill-assists are always nice), or even actually killing any of the opposition. His only care is the disruption of the enemy.
One of the greatest of these moments is at the start of a new round on 2Fort. The only real time you get so many players crossing the bridge. An early, decisive strike can leave the opposition on the back foot for the rest of the round.
In comes the Pyro.
He leaps off the battlements, sniper fire hitting the wall behind him. Down he sails, and then forward. The mass of enemies in front of him. On he goes, holding fire until the last moment. Too early will slow him down before he reaches them. Then, the end of his flame-thrower almost touching the lead player, he clicks the trigger. Gas flows through the barrel, down to the pilot light at the end and it bursts into flame. The front row are quickly ignited, but he doesn’t hang around. He plows on through the hoard, igniting on all sides. Then the dark cloak of death surrounds him, he falls to the ground. Was it a Soldier’s rocket, a Heavy’s bullet? It doesn’t matter, his job is done. Did anybody die? He doesn’t care, the enemies charge was halted, their forces scattered.
[...] When it comes to the unlocks I’m a bit of a Pyro purist at heart, I only use the standard loadout with the exception of the Axtinguisher, since Pyro is an up close class anyway there isn’t much point in meleeing. I have never even used the Backburner or Flaregun. I don’t use the Backburner because I like the Airblast too much (as I covered way back when), and I don’t use the Flaregun because the shotgun is so useful against other Pyros (as I mentioned in my piece on the Pyro). [...]