I think part of the confusion here arises from conflating "U.S. flag air carrier" with "U.S. flag carrier," which are two entirely different things.
What is a "Flag Carrier?"
A country's "flag carrier," is basically the either official or unofficial "national carrier" of a particular country. For example, Air France for France, KLM for The Netherlands, Lufthansa for Germany, etc. The U.S. does not have a flag carrier, though many decades ago (mostly during and before the 1960s) Pan Am was sort of an unofficial one. A country having a "flag carrier" is mostly a matter of national prestige, but can also be seen as a matter of national security (both military and economic) in the form of ensuring a country can maintain international air service under its own control.
For example, countries maintaining a "flag carrier" for national prestige is the main reason that there are still lots of different major international airlines in Europe (typically one per country,) even though nowadays almost all of them are owned by one of three companies in practice (IAG, AF/KLM, or Lufthansa Group.) The U.S. instead has 3 major international airlines (and a few other smaller ones,) none of which hold any special legal status compared to the others, so there is no "flag carrier" of the United States.
What is a "U.S. Flag Air Carrier?"
What they mean by "U.S. flag air carrier" for the purpose of the Fly America Act, though, is something completely different. Specifically, it means an air carrier that is "flagged" in the U.S. This means that the air carrier received its operating certificate from the U.S. FAA (which, in practice, generally means that the airline is based in the U.S. and typically also that their aircraft are registered in the U.S.) The U.S. Department of Transportation maintains a list of U.S. certificated air carriers on their website. Basically, though, the idea is that you must travel on an American airline unless that's not possible or your travel qualifies for one of the exceptions listed on the General Services Administration's website.
As far as the question about tickets operated by multiple carriers, GSA's website does address that part also:
Occasionally, two or more airlines will "codeshare" a flight by publishing and marketing the same flight under their own airline designators and flight numbers. You can purchase a seat on each airline’s designator and flight number, but the flight is only operated by one of the cooperating airlines. To comply with Fly America regulations, you must purchase the flight via the U.S. airline’s designator and flight number if the flight is shared between a U.S. and a foreign airline.
Note that there's a difference between merely purchasing a ticket sold by a U.S.-flagged airline and purchasing an actual codeshare. The important part here is the flight numbers that appear on the ticket. For example, if American Airlines sells a flight with an AA-coded flight number (e.g. AA6939,) that's ok even if the flight is actually operated by one of their partner airlines, such as British Airways. However, if the flight is sold to you by American Airlines, but with the flight numbers of one of their partner airlines (e.g. BA0178,) then that does not qualify, even though the flight is sold by American.