The idiom “square peg in a round hole” expresses a mismatch or misfit, often referring to somebody in the wrong profession. It may also indicate a difficult or impossible task but, of course, it is quite simple to fit a square peg in a round hole, hammering it in until the corners are tight against the circular boundary of the hole. Since the peg may be oriented at any angle, there are an infinite number of ways to fit a square within a circle. In contract, for a boomerang-shaped hole, there is just one way to draw a square with its vertices on the curve.
Otto Toeplitz (1881–1940) was a German mathematician who worked for some years in Göttingen, later in Kiel and then in Bonn. In 1939 he emigrated to Palestine. In 1911 Toeplitz posed an interesting problem: Does every Jordan curve contain an inscribed square? More explicitly, for an arbitrary simple closed curve is it always possible to find a square whose vertices are on the curve? This is known as Toeplitz’ Conjecture or the Square Peg Problem (or inscribed square problem). Recall that a simple closed curve, or Jordan curve, is a one-one continuous image of the unit circle in the plane. It is a non-intersecting loop in R2. The square may or may not be contained within the curve.
For triangles, the answer is “it depends”. For acute angled triangles, there are three ways to inscribe a square, as illustrated here. For right-angled triangles, there are two ways. For obtuse triangles there is just one solution.
For convex curves, the answer to Toeplitz’ question is “yes”. This is also the case for smooth curves, but in general the problem remains unsolved. It is true for polygons, and we might expect that, since an arbitrary curve can be approximated by polygons, the problem could be solved in this way. But there is no guarantee that a sequence of squares will not tend to a single point, so this apporach to a proof has been unsuccessful.
While the general Toeplitz problem remains unsolved, it is known that it is always possible to find a rectangle with corners contained on an arbitrary Jordan curve (See 3Blue1Brown video). For a survey on the Square Peg Problem, see Matschke (ref below).
B. Matschke, A Survey on the Square Peg Problem. Notices Amer. Math. Soc., 61, 4, 346–352. [ PDF ]
3Blue1Brown Video on the solution of a weaker form of Toeplitz’ Conjecture: YouTube
Terence Tao, 2016: An integration approach to the Toeplitz square peg problem. What’s New, November 22, 2016.
Wikipedia: Inscribed Square Problem.