Also, at wits' end. Completely puzzled and perplexed, not knowing what to do. For example, I've tried every possible source without success, and now I'm at my wit's end. This idiom, which uses wit in the sense of “mental faculties,” appeared in Piers Ploughman (c. 1377).
The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.