Probably the first intentionally painted impossible object was the gallows in Pieter Breughels canvas The magpie on the gallows of 1568 (Hessisches Landesmuseum Darmstadt, left a detail). It is an impossible 4-bar construction. Supposedly Breughel rather played with the perspective and intended to generate a surreal atmosphere than to represent a spatial object.
The first consciously constructed impossible object is the impossible tribar construction (see the figure below). The Swedish artist Oscar Reutersvärd invented it in 1934, and in 1956 it was reinvented independently by the English mathematician Sir Roger Penrose and his father. Their result was published two years later, when the famous picture Belvédère of the Dutch graphic art designer M.C. Escher was presented. Here a boy dressed in medieval style plays with aimpossible cube (figure on the right).
Also interesting is the self-referring development that the discovery (invention?) of the impossible objects made: Oscar Reutersvärd already drawed them when he was a pupil, but actually was aware of his discovery after the publication of the Penroses' article. Roger Penrose's interest in paradox representations was roused by an exposition of Escher which took place parallely to a mathematician congress in Amsterdam 1954. Escher in turn was inspired by the Penroses' article and invented the impossible cube, developed the Penroses' ideas (the impossible tribar and the endless stairway) further and applied them in numerous fantastic pictures.