I am a dual citizen of the US and Canada and I’m flying from the US to the United Kingdom and using my Canadian passport to enter the United Kingdom. What passport do I show when I check in at the airline in the United States for my flight leaving the US to the UK. It seems that the US government require one to leave the US on a US passport although there is no exit immigration from the US but the airline suggest that I put in my Airline file the passport I’m using to enter the country at my destination, the UK. If I show my US passport when I check in with the airline but I have a Canadian passport in my file will that create a problem and on the other hand if I just leave the US on my Canadian passport and return home weeks later and enter with my US passport will there be a problem
Leaving really does not matter, if in the US, you might as well use your US Passport, only the airline is looking at it, and their requirement is a valid passport.
Arriving in UK, you may use your Canadian passport, not sure it really offers any advantage in the UK, but you are free to do so. What passport you showed to the airline is irrelevant, the UK is only concerned about what you show them at entry. You will need an ETA with either passport.
The UK really does not do exit immigration, but probably should use whatever passport you came in on.
Entering the US is the only hard requirement, you must show your US passport.
That's complicated. As a dual citizen, when I fly between my two countries, the law states I have to use the passport of the country I am entering. However, upon checking in to exit the US, I use my US passport. Upon exiting France, I show both passports in order to prove that I have the right to enter the US without obtaining a visa. I let the airline employee decide which one to put on the manifest.
In your case, you are flying to a third country, and your Canadian passport has no advantages for UK entry. You have to get the ETA with either passport and the ETA must in the passport you used for the ETA application. Checking in for both flights, you should use your US passport, particularly to prove that you have the right to enter the US without a visa.
As stated above, the only hard rule is that if you hold US citizenship you must enter the US using your US passport. If you plan to enter the UK on your Canadian passport, you can also check in with the airline for the outbound flight on your Canadian passport. However for the flight home you can check in with your US passport. Is there a reason you are planning to use your Canadian rather than US passport to enter the UK? I'm not sure it will give you any advantages, and just means you need to travel with two passports the whole time.