For a summary of the mountain of research done in the field, I recommend “Intelligence: All That Matters” by Stuart Ritchie:
> There is a strange disconnect between the scientific consensus and the public mind on intelligence testing. Just mention IQ testing in polite company, and you'll sternly be informed that IQ tests don't measure anything "real", and only reflect how good you are at doing IQ tests; that they ignore important traits like "emotional intelligence" and "multiple intelligences"; and that those who are interested in IQ testing must be elitists, or maybe something more sinister.
> Yet the scientific evidence is clear: IQ tests are extraordinarily useful. IQ scores are related to a huge variety of important life outcomes like educational success, income, and even life expectancy, and biological studies have shown they are genetically influenced and linked to measures of the brain. Studies of intelligence and IQ are regularly published in the world's top scientific journals.
> This book will offer an entertaining introduction to the state of the art in intelligence and IQ, and will show how we have arrived at what we know from a century's research. It will engage head-on with many of the criticisms of IQ testing by describing the latest high-quality scientific research, but will not be a simple point-by-point rebuttal: it will make a positive case for IQ research, focusing on the potential benefits for society that a better understanding of intelligence can bring.
Precisely because, as you said, "it doesn't work." There's not a good amount of evidence that IQ tests (which vary wildly, BTW) are a valid measure of cognitive ability or an indicator of aptitude toward a task (perhaps other than mental arithmetic or something). It only causes people who may be bad at rotating shapes in their mind or whatever to be discriminated against.
https://en.wikipedia.org/wiki/G_factor_(psychometrics)
Look at the figures in the "Cognitive ability testing" section -- see how strong those correlations are across the disparate fields of Classics, Math, and Music!
In other words, there is a mountain of evidence that IQ tests correlate with an extraordinarily broad range of aptitudes in daily life, and especially with job performance. IQ is the single most important psychometric correlate with job performance and income of any out there; it's a much stronger signal than race, gender, birthplace, or personality for instance:
"Research indicates that tests of g are the best single predictors of job performance, with an average validity coefficient of .55 across several meta-analyses of studies based on supervisor ratings and job samples."