Originally, this meant "an
aircraft whose purpose was the destruction of other aircraft in
air combat." This was distinct from
bomber and
transport aircraft. The first armed fighter planes appeared during
World War I when pilots and observers - dissatisfied with the practice of taking hand weapons up in open cockpits, which was what was available at the time - began to experiment with mounting dedicated (heavier) weapons on their airplanes.
Early fighters were built strictly to down other aircraft that looked like them. This is because the original purpose of the aircraft in war was for observation and reconnaissance, so downing enemy airplanes (and balloons, dirigibles and blimps ) would deny them information. However, as soon as arming these airplanes became widespread, models began to be introduced whose primary purpose was clearing the sky of other armed aircraft so that dedicated observation aircraft and balloons (as well as currently-unemployed fighters) could be used to scout.
By World War II, however, the category began to become a bit hazy with the introduction of small airplanes with systems dedicated to ground attack - unguided rockets, slow-firing cannon, etc. These were still called fighters, however, since they were usually of a common base model with purely air to air assets, and could perform the same function in a pinch (although 'in a pinch' came more and more to mean 'in self-defense').
By the end of World War II, though, things were getting confused, with mid-sized planes which were bigger than other fighters and used mostly to bomb or attack ground targets - but which, like the Mosquito, were fast enough and maneuverable enough to keep up with most frontline air combat types. The introduction of jets made things worse - the differing requirements on the airplane began to become much more contradictory. Ground attack aircraft needed to be able to fly low and slow, provide good gun platforms, and be able to absorb damage from unaimed but thick ground fire. Fighters began to push the performance envelope further and further, especially with the introduction of missiles - they became faster, less stable at low speeds, and more fragile, trusting in the 'first hit' and the punishing demands of high-speed flight to disable their opponents.
However, the ground attack aircraft were not really bombers. Most of them used direct-fire weapons, although some could be (and were) equipped with bomb racks. What to do?
Eventually, they came to be called 'attack' aircraft. As jets began to move back from pure speed towards agility, and engines became more powerful, airplanes began to once more be able to fulfill both roles. The Vietnam War pushed the U.S. towards developing ground-attack aircraft, as there was a lack of aerial opponents and a need for close air support and observation airplanes. The staring match called the Central Front, where NATO and the Warsaw Pact stood eye to eye, spawned dedicated tank-killing airplanes like the Su-25 Frogfoot and the A-10 Warthog. The 'A' in the latter indicates its role as 'Attack'.
As budgets crunched and airplanes became wildly more expensive, though, users found ways to make them do both things. The Israeli Air Force took the U.S. F-16 Fighting Falcon, designed and built as a 'pure dogfighter', and found that it made an excellent dive-bombing platform and promptly stuck ground-attack gear on it and bomb-release functions into its electronics. The U.S. Air Force, taken momentarily aback, jumped on this with alacrity; since the F-16 was originally a day interceptor only, the additional duties made it much more useful.
By now, with program costs hitting the stratosphere, the U.S. and others were building dedicated 'dual-role' airplanes. The F/A-18 Hornet is one such whose designation reflects its somewhat split personality. Most airplanes of this type are still called 'fighters'; what they actually are busy doing depends on what kind of loadout they are carrying.
Just to be confusing about it, the U.S. went and designated its first stealth aircraft the F-117 and called it the Stealth Fighter, which was originally its only name (penalty of being so secret). This was likely to distinguish it from the Stealth Bomber, but the problem is that the Stealth Fighter is in no way designed to engage other airplanes. It can1, in extreme circumstances, using internally-stored weapons, but only if its job is to sneak up, backstab some poor baby seal of a non-stealthy airplane, and run like hell. It surely can't dogfight.
So after all this, what's a fighter? It's easy to quote the original definition. It's easier to keep that definition relevant by including attack as a type, and splitting dedicated airplanes out into that category and only including pure interceptors and dual-role airplanes in the 'fighter' role.
1 Ulkesh points out that the F-117 does not carry any air-to-air munitions at all, and hence could not engage other aircraft. While I agree that I haven't seen any reports of it doing so, the USAF is adamant that it can carry two of "anything in the inventory", and persists in calling it a "Fighter/Attack" aircraft (as per their fact sheets). While it's true that this is quite likely PR posturing, I'm leery of categorically saying that it cannot engage air-to-air targets - after all, the F-22 Raptor will carry its air-to-air munitions in an internal bay for stealth advantages. Although the F-117 does not have a radar on-board, it is theoretically possible for radar-guided and IR-guided weapons to be 'cued' while still inboard, then dropped - and the Sparrow is designed to home passively off radar reflections, which need not come from the launching aircraft.
I know, it's thin - but that persistent designation means I won't rule it out, unless anyone knows for certain (i.e. has postive knowledge). If so, let me know (if you can).