Act the giddy goat
The phrase 'act the giddy goat' (or 'play the giddy goat') wasn't coined from scratch but was built up by degrees from earlier phrases. 'Giddy' has been used to mean foolish or stupid since the first millennium and has been applied as an adjective to all sorts of creatures. Prominent amongst these was the ox and there are several citations of 'play (or act) the giddy ox' which pre-date the 'giddy goat' variant; for example, the British comic Ally Sloper's Half-Holiday used the phrase in a March 1892 edition:
"Fanny Robinson was flighty; she played the giddy ox - I mean, heifer."
We also find 'acting the goat' from 1879, when H. Hartigan included it in his memoir Stray Leaves from a Military Man's Note Book:
"Don't be actin' the goat."
From 'acting the goat' and 'playing the giddy goat', it isn't much of a jump to 'acting the giddy goat'. This is the 'giddy' phrase that has lasted, possibly because of the alliteration. Also, the behaviour of goats can well be called giddy; they are certainly capricious - 'capra' is the Latin for goat.
All the early references in print come from Australasia. The first mention of it that I can find is from a New Zealand source, The Auckland Observer, September 1895:
A contemporary notes that while the Colonel Treasurer is acting the 'giddy goat' down south, the House filled in its time with a stray Lunatic Bill.
See also: My giddy aunt.