It's easier to get J. Edgar into politics -- he was a law student at Georgetown, and certainly moved in the right circles to get into politics from a young age. Getting him into the White House is harder given the timing.
Getting Herbert into law enforcement requires some odd shifts, presumably in his earlier years. I'm not as well acquainted with Herbert Hoover's early life; does anyone know if there was a point where instead of geology, he demonstrated any interest in law and order? Reading
this brief biography suggests that Herbert was always a math and science sort of fellow from a young age.
But let's give it a try...
Herbert lived with his uncle in Portland during the 1880s. Let's say that the
Oregon land fraud scandal captures his attention, and, in a fit of moral disgust, he helps expose it, coming into contact with the United States Attorneys in the region. Instead of studying geology, he studies accounting, bookkeeping, and finance harder, and becomes one of the fathers of modern forensic accounting, such that when Teddy Roosevelt stands up the BOI (in no small part in response to that same land fraud scandal!) Herbert Hoover is a natural choice to be hired to come to Washington in 1908, being one of the men Stanley Finch wants to join as an examiner along with A. Bruce Bielaski. Instead of Bielaski, it's the slightly older and more famous Herbert who takes over as head of the Bureau of Investigation in 1912, where he continued to lead the Bureau into the thirties.
Meanwhile, J. Edgar, while at Georgetown, finds work as a clerk at a Senator's office rather than as a messenger and file clerk at the Library of Congress. This starts him down a career of politics: in 1920, he gets elected over in Delaware as a Congressman on Harding's coattails. "Fast-Talking J. Edgar" spends the rest of the 20s climbing the party ranks, becoming increasingly indispensable: at least one wit in a column contrasts J. Edgar's rapid-fire manner of speech with Coolidge's reticence, for instance. In 1928, J. Edgar is appointed to complete DuPont's term in the Senate, where he gets re-elected. He's named as the Vice Presidential candidate in 1936 to Landon, but that of course goes nowhere. However, he has the last laugh, as the headlines blare "Hoover Defeats Truman" in 1948; he serves from 1948 - 1956.
Will that do?