Hit the jump to see.
When playing as him:
Upon leaving the spawn point at the beginning of a round, an Engineer should immediately build a teleport entrance. This way, the Engineer can build an exit for said teleport at any time and place of his choosing; this not only makes it easy to get back to where you left off should you die, but it also makes it easier for your allies to warp to your location and give backup. The cost of building teleports is relatively low and the benefits of having quick access to distant areas of the map are innumerable; all told, there's really no reason not to have a working teleport system up.
-Teleports as idiocy detectors
Unless, of course, you're playing 2fort and you want to test the intelligence of the Spies who will invariably attempt to invade your flag room. After building a sentry and a dispenser, you might find it interesting to build a teleport entrance in the middle of one short hallway leading to the flag room, and an exit in the middle of the other.
These teleports serve no immediately evident functional purpose (unless you really, really need to warp across a distance of five feet), but they serve as great bait for inexperienced, stupid, and/or point-greedy Spies. Since Spies get points for destroying any Engineer structures, many Spies will sap literally anything they come across, including the entrance and exit you place outside the map room. While their decision to sap these structures will inevitably result in their gaining a couple of points, it tells the Engineer inside the map room several important things.
Firstly, it lets the Engineer know that a Spy is currently in very close proximity to the map room. Secondly, by checking to see which teleportation structure has been sapped (entrance or exit), the Engineer knows exactly where the Spy is. Thirdly, it lets the Engineer know that the spy is kind of dim (a fact which should be taken into account when composing a short-term strategy).
If your team doesn't already have a teleport from the spawn area to the map room, don't bother with this cleverly dick-ish strategy; the teleporter-as-idiocy-detector should only be used when the map room is sufficiently defended by structures and accessible by other portals.
-Dispensers go first
I know you want to get the Sentry gun up really quickly, so's you can automatically eliminate any Scouts who might happen your way. I understand. I empathize. However, it is far more important to quickly build a dispenser -- a structure which not only supplies you with metal for building, but also gives health and ammo to any team member who approaches it -- than it is to get a few quick kills.
Besides, after building a dispenser, the process of upgrading your sentry gun will go a lot quicker. There's nothing more irritating -- or pathetic -- than watching an inexperienced Engineer create a sentry gun, attempt to upgrade it to level two, and then run out of metal, thus forcing him to abandon his sentry to find more (a choice which typically results in the destruction of said sentry gun).
Additionally, Dtoider Charlie keyed me into a strategy involving the fact that if a group of allies stand near a dispenser and block it from enemy fire, they will not only be continually healed, but will also never run out of ammo thanks to the dispenser's gift of ammo replenishment. This means that you can park a few Pyros or Heavies near a dispenser and let them fire away to their heart's content, either as an unstoppable defensive force or a powerful offensive one.
Dispensers are also invaluable during Sudden Death rounds, considering the refill lockers are the respawn points cease functioning once these rounds begin.
-Restock on metal at the spawn point
The refill lockers at a respawn point can often be an Engineer's best friend. Depending on which area you're defending, you're probably within decent running distance of your team's base, and the metal recharge that lies within. As a result of this, it's often quicker to simply build a dispenser, sentry, and teleporter exit before quickly running back to the respawn point, refilling your metal reserves, and teleporting back to your original location.
This strategy can be tricky as it involves leaving nearly all of your structures undefended for a good sixty seconds, but it can still sometimes serve as a quicker method of gathering metal than scavenging it off corpses or ammo boxes. If you need to upgrade a sentry gun to level 3 really quickly, and you're willing to take a calculated risk, consider running back to your base.
I'm not entirely sure why so many Engineers insist on using their sentries as offensive weapons, but it tends to happen a hell of a lot. Some guy (probably thinking himself the cleverest man on the planet) will build a sentry gun roughly fifty feet ahead of the next unobtained capture point, and frantically try to upgrade it to level 3 before some random Soldier destroys it.
This strategy may result in a few kills and giggles, but it's really not viable as a long-term use of the Engineer's skills. When one or two enemies try to take out a sentry gun on their own, they'll usually die in the process. Putting a sentry gun roughly twenty feet away from an entire army of enemies, however, will usually result in a quickly-destroyed turret and an embarrassed-looking Engineer.
Additionally, this style of Engineer usage gives the rest of your teammates a sense of false security. After hitting the Tab key and seeing that they have an Engineer amongst their ranks, your teammates wrongly assume that you are defending their flag/command point, and subsequently surmise that they don't need to spend any effort on defending said flag/command point themselves. Fifteen minutes later, a rogue Scout happily sprints into your flag room, sees not a single sentry gun or living soul, and steals the flag from right underneath your team's collective noses. The Engineer's duty is to defend; playing otherwise can literally screw up an entire team.
-Build your turrets behind corners
Never give bad guys a line of sight to your sentry gun until it's too late. Sentry guns do have a limited range, and this makes them vulnerable to Sniper bullets or Soldier rockets; placing your turrets behind corners or doorways forces your enemies to get up close and personal in order to attack it, by which point they'll hopefully have exploded in a burst of bright red goo.
-Hide behind your structures
The Engineer's biggest enemy is, by far, the Spy. The Spy has the ability to freely sap any and all of the Engineer's structures, and can instakill the Engineer himself with a backstab, leaving him unable to repair his buildings. For this reason, diligent Engineers will station themselves behind a barricade made of their own structures: a dispenser covers the right flank, a sentry gun covers the left and middle.
From this position, Spies can still sap your buildings, but you can quickly and easily destroy the sappers with a few wrench hits without exposing yourself to the Spy. The Spy will (A) run away, in which case you don't have to worry about him; (B) take out a gun and attempt to shoot you to death, which will directly lead to his demise once you unsap your sentry gun and the disguise-less Spy is immediately blown away; or, (C) will once again stubbornly sap your structures, perhaps hoping that you will somehow fail to destroy his sappers quickly enough, leading to the slow-but-eventual destruction of your gun and dispenser.
A and B are pretty easy to deal with, but should you ever find yourself in situation C, simply wrench his first two sappers, repair each structure with a quick wrench thwack, blast him once with the shotgun, wrench the next two sappers, repair the structures, and blast him again -- you have to work quickly, but if you aim correctly and switch between your weapons without pausing, you should easily be able to kill the Spy and keep your buildings intact.
-The wrench is mightier than the sword
Granted, there is no sword in Team Fortress 2, but even if there was, the Engineer's wrench would still give it a run for its money.
Many players tend to view the wrench as a purely repair-oriented tool, to be used solely for upgrading sentry guns and destroying sappers. These people are missing out on the sheer joy of beating someone to death with a cartoonishly oversized spanner. While I haven't done a detailed, comparative study of the melee weapons, the Engineer's wrench seems to be about as powerful as the Medic's sawblade -- which is to say, very. Three good whacks can kill a Soldier at full health, and one or two can deal with any pesky Spies who might try to sap your stuff.
The shotgun is probably preferrable for most close-quarters encounters, but don't be afraid to switch to the wrench when you run out of ammo (or if you just want to be stylish).
When playing against him:
Unless the Engineer is a complete idiot (in other words, if he doesn't adhere to the above suggestions), you're probably not going to want to take the Engineer on by yourself.
Ideally, one should use a combination of Spy and Demoman or Spy and Soldier; the Spy saps the Engineer's sentry gun and dispenser, and while the Engineer frantically attempts to knock off the saps*, the Demoman/Soldier should blow the living hell out of the Engineer's structures (which, if the Engineer is really paranoid about getting backstabbed, should be really close to one another and thus easier to blow up). The Engineer will destroy the Sentry sap pretty quickly, but if the Spy immediately puts one back onto the gun, the Engineer will literally have zero time to deal with the grenades and/or rockets heading in his direction. He'll either get really overwhelmed and have to watch all his structures explode before making a quick escape, or he'll die, which will allow the Spy to sap his leftover buildings to death with zero resistance.
If you can't find a partner, however, and if you think the Engineer is the twitchy type who is likely to run to away to the nearest flag point/control room in order to help defend the area with his primary weapons, you might want to consider going Soldier and simply firing a metric asston of rockets at the sentry. So long as no one is around to repair it, the sentry should go boom after about four or five direct rocket hits.
A lot of Demoman try to be really clever by ricocheting grenades into sentry guns whilst staying out of its line of sight, but this strategy is only feasible in theory. Firstly, the Demoman can't possibly tell if he's doing damage to the sentry gun, or even landing his grenades anywhere near it, as he can't actually see the turret. Secondly, this strategy really only works if the Engineer isn't standing next to his sentry, ready and willing to repair it at the slightest hint of danger. I don't mean to discount the strategy altogether, as it occasionallyworks, but it tends to require a combination of Engineer negligence and exemplary Demoman skill that most players just aren't lucky enough to achieve on a regular basis.
Oh, and you can always just get a Heavy Weapons Guy, have two medics simultaneously heal him, and roll him out in front of the sentry. Assuming the HW Guy doesn't get attacked by anyone other than the turret, he should easily be able to destroy the sentry gun before getting ganked. Plus, there's always the Ubercharge.
*I originally wrote this sentence as, "the Engineer frantically attempts to whack off the saps," which is wildly inappropriate