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.