The US is on the brink of a federal government shutdown after hard-right Republicans in Congress rejected a longshot effort to keep offices open as they fight for steep spending cuts and strict border security measures that Democrats and the White House say are too extreme.