For a number of decades (at the beginning).....we didn't really need to worry about crime crossing state lines. It probably existed, but with a warrant from some county judge, you as a county sheriff/deputy...could cross the border and apprehend the suspected criminal.
Around the 1850 period, we had a new category to developed....called the 'Pinkerton-Men'.
This was a commercial group of folks who served two purposes.....detectives and private security guards. You could make the case that railway traffic and related crime brought them about.
The federal government procuring their services? Yes. In 1861, Lincoln hired them, to provide services during the war.
For about forty years, the Pinkerton-Men were a organization that were commercial in nature, with federal powers granted to them.
In 1908, the federal government decides to take the basic idea of the Pinkerton-Men and form the FBI.
Can we exist today without the FBI? I would say mostly 'no'. Because of the terror business, and cross-state-line crimes....you need some type of agency to handle these.
Could the US Marshalls perform half the functions of the FBI? That's continually brought up, and probably worth a long review.
Domestic terrorism requiring a dedicated force? That's also continually debated, and one could imagine the US Marshalls handling the bulk of this mission.
Once we reach 2024, I would imagine a whole year will be spend in disassembling the FBI...into something of a compact nature, with the US Marshalls likely to gain more purpose and missions.