'On the fritz' is an expression used to describe a mechanism or device (more frequently an appliance) which is behaving unexpectedly, unpredictably, or simply not at all. Typically, only items with components which can't easily be described on their own by a layman receive this label -- washing machines, televisions and microwaves are often described as on the fritz, while cars and yachts are not. The British / Australian equivalent is probably, 'on the blink'.

There have been a number of attempts to explain the origin of this phrase. Two are easy to fairly easily dismiss out of hand -- American poet and author John Ciardi wrote it was possible that 'fritz' may be an onomatopoeic reference to the 'pfzt' sound of a faulty connection / short circuit, while others felt that 'fritz' might be a reference to German soldiers in World War II. Merriam-Webster gives a first-spotted date of 1903, where it appeared in the 1903 Oxford English Dictionary which appears to deflate both of these claims, however, the German line of thought deserves more investigation -- the use of 'Fritz' for a German soldier actually significantly predates World War II. There was a popular World War I era song by Arthur Fields entitled, Keep your head down, Fritzy Boy and the faq for the usenet newsgroup uk.culture.language.english suggests the term is at least as old as 1883, likely originating with Frederick the Great of Prussia.

The earliest known uses of this phrase involve references to a poor state of domestic affairs, the unimpressive reception of a stage show, and an injured leg.

The origin I most prefer refers to what is considered by some to be the world's first comic strip, created in 1897 by Rudolph Dirks, The Katzenjammer Kids. This strip focused on two mischievous children, Hans and Fritz, who would cause all manner of trouble for their elders -- sabotage, destructive pranks, etc. Unfortunately, although the dates line up, there's not much else in terms of supporting evidence -- and why don't we hear of toasters being on the hans?

Sources:

Merriam-Webster Online:
http://www.m-w.com
World Wide Words -- Investigating international English from a British viewpoint:
http://www.quinion.com/words/
Internet FAQ Archives
http://www.faqs.org