The Pyro is actually one of Team Fortress 2's most effective assault classes, it's soul purpose being the spreading of chaos. If used properly, a Pyro can become a dangerous and essential member of any team.
Basic Strategies
With 175 health and a weapon set that forces them to get up close and personal, a good Pyro needs to find quick and efficient ways to get to the enemy before the enemy sees them. It sounds odd, but I'm basically saying that the Pyro needs to use the art of stealth. Anyone that is used to playing Spy shouldn't have a problem with this, but for the sake of everyone else, I'll explain:
Shortcuts
Charging strait at the enemy, flames blazing, is a bad idea that will only get you killed. Despite how some people claim it's a valid strategy, this is what inexperienced or outright bad players do, and that's why they die. As a Pyro, you want to be able to catch the enemy off guard. When engaging the enemy, that should always be your goal.
The best way to accomplish this is to learn the map and all of the ways you can quickly get across it. Every map has several different paths and levels, and as a Pyro you should be able to use the map itself to flank and ambush the enemy. Running away from where the main battle is and finding a way around to the enemy's back is something you should always be thinking about.
Start jumping off of things so you can land right on top of the enemy and kill them then. Just about every drop in a map has something you can land on that'll keep you from taking damage (ex. the machines in the center of Turbine). Memorize the map so you not only have a plan of attack, but a way to escape once the job is done.
Stalking
Commonly thought of as a Spy strategy, stalking is the art of trailing an enemy and then going in for the kill. Spies need to do this by necessity to get backstabs, and Pyros need to learn how to do it as well. After all, an enemy is most vulnerable to attack from the place they least expect, and that is from behind.
Stealth as a Pyro isn't all that difficult, even taking into account that a Pyro is wearing bright blue or red. Because of their hunched posture, a Pyro can crouch behind a box and can be slightly harder to spot. The main goal of a stalk is not to be seen. You want an enemy not to notice you as they walk through an area. This can be easily accomplished by lurking in the shadows, hiding behind something, or even being a level or two above the target. Whatever the case, once they're in front of you, the hunt is on.
You want to stay behind the target and get as close to them as you can. Watch the path they take and then start finding ways to catch up. Cut corners, jump gaps in stairwells, and follow the curves of a hallway closer. Just try to get as close as possible as quickly as possible. Once your right on top of them, let loose and let them have it. The sudden intensity and brutality of a fire-based sneak attack will cause the enemy to panic and you'll usually be able to kill them with no problem whatsoever.
Water
You don't have to be a genius to know that water puts out fire (and if you didn't know that, you do now). So, when playing as a Pyro, there are two things that you should do:
1) Stay the hell out of the water
2) See Point #1
A Pyro is at it's most effective when using it's flamethrower. Water in a map puts out burning enemies and prevents you from even igniting even the smallest flame. If there's no choice, your Shotgun and your Fire Axe will be your best friends.
Equipment Loadout
During your exploits as Pyro, you'll end up acquiring achievements and, as a result, end up unlocking additional weapons. Let me help you get an idea of what's what.
Flame Thrower vs. Back Burner
Thanks to Valve nerfing the Back Burner by taking away it's health bonus (which, surprisingly, I'm going to say is a good thing), the choice between these two has become purely tactical. It comes down to only one thing: do you want to be direct, or be subversive?
If you prefer a direct, assault-oriented approach, you'll need to stick with the basic Flamethrower. Like all weapons, it offers up random crit damage based on your performance. The important thing to remember is that the Flamethrower has a compressed air blast. The air blast uses 25 of the flamethrower's ammo with each use, meaning that eight blasts can completely drain the Flamethrower's ammo supply. An assault Pyro uses the air blast to clear sticky bombs out of the way of an assault party and reflect back enemy projectiles. If that wasn't enough, the air blast can push back enemies, separating Medics from their charges and pushing back those too close for comfort. The following things can be reflected by the air blast:
Solder Rockets
Demo Grenades
Sticky Bombs
Sentry Rockets
Pyro Flares
Medic Syringe Needles
It should be noted that the air blast only reflects back one syringe needle per blast. So, taking both the firing rate of the Syringe Gun and the Flamethrower's air blast into account, you can reflect one out of every six needles shot at you, making it hardly worthwhile. You cannot deflect bullets of any kind.
The Back Burner is geared for Pyros that prefer to be indirect and ambush their prey. While the Back Burner does not have the air blast, it does causes instant, guaranteed crit damage every time you hit an enemy from behind. So, in a nutshell, it's kind of like a flame-based backstab. Coming up behind a large enemy push or a Heavy-Medic duo can be devastating to the enemy team. Most people will be dead and burning on the ground before they know what hit them.
Shotgun vs. Flare Gun
This decision is a lot more straightforward. After you unlock the Flare Gun, you might as well put it on your shelf next to that blender your brother-in-law gave you last Christmas, because you will rarely use it.
Your shotgun is you ideal back-up weapon. It works very well at close-to-medium range, making it the go-to choice for dealing with scouts and enemies outside of range for a flame attack. The shotgun will be possibly one of your most used weapons because, after all, we can't always be close-up enough for the Flamethrower. It should be your weapon of choice in the event you end up in a fight underwater. Finally, everyone is vulnerable to some well-placed bullets, unlike the alternative...
The Flare Gun, on the other hand, is more of a special-use weapon. It's only really good for use at long range to harass enemies far away, like snipers or engineers tending to buildables. To effectively aim with the Flare gun, you need to aim a little above your target because the flare flies in a downward arc. This makes it difficult to hit enemies the farther away they are, so it takes a little practice. It has a slow firing rate and causes 20 damage, you it isn't a good weapon to use in the middle of a firefight. However, it does ignite the target if they are hit, burning them for extra damage. As you would imagine, the Flare Gun is useless underwater.
Fire Axe vs. Axetinguisher
The Fire Axe is your standard, default melee weapon. It Fire Axe crits naturally with every fourth swing (when the animation has the axe moving horizontally from right to left). When the axe crits, it will usually kill most enemies with a single strike, if not mess them up something fierce. In a "Melee Only" situation or in a fight underwater, the axe you want to use is the Fire Axe.
The Axetinguisher has a slower drawl time (i.e. it takes longer to get out) and a slower attack rate as well as doing half the damage of the Fire Axe with no chance of random crits. However, if you hit an enemy that is on fire with the Axetinguisher, it will always be a critical hit. With every class except the Heavy it will kill them instantly. The Heavy will die in two hits from the Axetinguisher. It's only useful when fighting burning enemies, so you might as well leave it at home in "Melee Only" matches. If that wasn't enough, it's dead weight in any situation in the water. It's also useless against enemy Pyros because they cannot be set on fire.