Why is the F-16 still in service?
The simplest answer to your question is that the F-16 has not yet been retired because, for its cost, there's nothing better being built in enough numbers to replace the nearly 4500 Falcons produced.

The F-16 was designed on the trailing edge of a surge in technological development by the U.S. military in the wake of Vietnam. The U.S. had fought that war with an air force primarily designed for a standoff engagement with the Soviet Union directly, thus emphasizing interceptor-style fighters targeting bombers at extreme range using missiles. Robert McNamara, U.S. SecDef for the Johnson and Nixon administrations, also emphasized a "one-size-fits-all" approach to aircraft design, requiring the USAF and Navy to collaborate on common aircraft designs that covered a multitude of mission profiles. This created the F-4, a fast but heavy plane that was a handful to fly, weaknesses that were exploited by pilots of technologically-inferior MiG-19 and MiG-21 aircraft in close combat engagements that the Phantom was ill-prepared to fight.

The lesson "dogfighting isn't dead" prompted a renaissance in jet fighter design in the 70s, producing the F-14 and F-15 long-range air superiority fighters, and the smaller F-16 and F/A-18 multirole fighters. Maneuverability, a wide range of weapons from guns to long-range missiles, and high pilot situational awareness by reducing workload and integrating flight and fire control systems, were all emphasized strongly.

The Soviets were taken somewhat by surprise at this surge; as of when the F-16 first flew, the Soviet air force and those of its allies had nothing that could compete. They answered a few years later with the MiG-29, a smaller twin-engine design similar to the larger Su-27 which was in pre-production to answer the F-15. These six fighters - F-14, F-15, F-16, F/A-18, MiG-29 and Su-27 - represented the cutting edge of fighter design as of the collapse of the Soviet Union in 1991. 

The new U.S. designs to enter production since, the F-22 Raptor and F-35 Lightning II, are themselves fairly old; the first production F-22 was built in in 1996 and flew in 1997, almost 20 years ago, the result of a design competition with planes flying back in 1990, and the initial RFP originating in the 1980s. The F-35 first flew in 2006, itself derived from the X-35 JSF testbed which first flew in 2000, so that design is between 10 and 15 years old now depending on how you count. Their protracted development times are a direct result of the reduction in pace of the U.S.-Russian arms race since 1991; with no other technologically-advanced military adversary on the horizon, there simply hasn't been the impetus to get these planes out to the front lines (there is some civilian talk of restarting the F-22 production line to bolster Raptor numbers, as the Sukhoi PAK-FA and Chengdu J-20 are very close to production and the F-35 is way behind projections and proving a disappointment so far, but another 100 new Raptors are projected to cost a ludicrous $225 million each due to increased costs of restarting the line and producing them in parallel with the F-35).

The F-35 also had the handicap of being a return to the "one-size-fits-all" design mentality, being intended as a replacement for practically everything besides the Raptor in the U.S. air arsenal, Air Force, Navy and Marines, with an F or A in its designation. That's caused a lot of technological headaches, since any replacement for the Marines' AV-8B Harrier is going to need STOVL capability, and the Navy and Air Force have always had a different though overlapping set of requirements relating to the Navy's basic need to operate aircraft from a ship at sea that's maybe a fifth as long as the USAF's minimum runway length requirements for its airbases. The resulting design is big, heavy, and relies on the most powerful single engine the U.S. has ever put in a fighter, which pushes the boundaries of the stress limits of the materials we use to make jet engines.

Lastly, military spending in the last 10 years or so has been preoccupied with developing and fielding technology to fight a low-tech insurgency; our enemies know they can't beat us in a toe-to-toe fight, so they don't fight that way, instead targeting our multi-million-dollar military hardware with Vietnam-era milsurp RPGs and oil-drum IEDs costing maybe $100 a shot. On this kind of battlefield, stealth air-superiority aircraft are kind of redundant as the enemy doesn't even have radar, much less an air force to exercise superiority over. That's why the F-22 has never seen real combat; the U.S. has enjoyed "air supremacy" by default in its primary combat theaters, as its enemies have never fielded an air force to speak of.