A series of short straight lines, set at angles to one another and connected to form a continuous line. Often forming a regular pattern, but not necessarily so. Also, the action of moving along such a course.
This term seems to have come into English from Continental Europe - The Netherlands, France, or possibly Germany. The origin is unknown. The reduplication is suggestive of alternation, as with other phrases of that sort, e.g. tick-tock and see-saw.
In 1706, the Dutch author Roelof Roukema published Naam-boek der beroemde genees- en heelmeesters van alle eeuwen [Book of Medicine and Healers]. This contains the line:
"eenige in de voorstad van St. Germain zig zag bewegen"
which loosely translates into English as:
"some in the suburb of St. Germain move zig zag"
The German word 'zickzack' dates from around the same time and is known (in Sperander) from 1727. That usage referred to the fortifications of castles, the walls of which were sometimes built in zig-zag form.
Zic-zac/zick-zack soon began to be written as zig-zag. The first record we have of that is in Johnathan Swift's prose poem My Lady's Lamentation, 1728:
How proudly he talks
Of zigzags and walks
It didn't take long for the term to begin to be used in a figurative sense, i.e. in reference to any continual changes; for example, in William Cowper's Conversation, 1781:
"Though such continual zig-zags in a book, Such drunken reelings, have an awkward look."
See other reduplicated phrases.