Recently I was visiting my grandfather and we went gun shooting, I shot a barret .50 caliber rifle and some other automatics and were able to keep a few of the casings as a keepsake. Is it legal to fly home with it in a carryon or must I put it in a bag on the top of my luggage?
There is no bullet, powder or primer, therefore you are not carrying ammunition. Tapered brass cylinders are not on the prohibited list. Baggage x-ray won't care in the slightest - you can put 20 live 50BMG rounds (and the rifle) in your checked baggage and they won't care (assuming the USA).
(If you really check an M-82 they might care a lot, but in the "can we try it?" sense)
They have a legitimate case against novelty keychains that appear to be a fully-loaded round, but anyone can tell that a spent case is ok. For comparison, I have taken an empty 500ml thermos on plenty of flights. Liquids are not allowed, aluminum flasks are.
I would just arrive extra-early, don't check your bags (yet), and carry them to security. If they refuse, you can go back to your suitcase. Bit more complicated if you are traveling alone.
Even if it is legal (which I don't know, and would likely depend on both the state you're flying from, the state you're flying to, possibly any state you're making stopovers as well), I'd not put it in my carryon because of the way the TSA is almost guaranteed to overreact.
Putting it in your hold luggage is less likely to cause them to go ape, but you still run the risk of having them break open your luggage and going through it.
Best you can probably do is send it home as a small parcel using something like FedEx or UPS (and be sure to comply with whatever rules they have for sending munitions through them).
I recently tried to carry unused cartridge cases in my hold luggage and the declaration at the check-in desk said that the unused cases had to be treated in the same way as live ammunition and carried in a separate locked hard-sided case checked in as hold luggage. Returning to United Kingdom from South Africa, Johannesburg - O.R.Tambo International Airport flying Air France. Not sure if this is an international ruling or one particular to South Africa.