I read somewhere once that flagged ships at sea are considered unclaimed territory of the nation of the flag. Is that true? If so would only federal law apply and not state? Would it be like being an indian nation (as far as level of autonomy) ?
If no flag flew (or your own) would it be illegal according to maritime law?
Depends where in the ocean you are. U.S. states claim different territorial waters. California claims 3 nautical miles (nm). Federal is 12 nm. So between 3 and 12 nm, federal law applies, but not state law.
Not having a flag is treated the same as being a pirate. Pirates are likely to be arrested by any nation, etc.