can you bring a razor on a plane?

It depends on the razor type if you can take a razor in your carry on bag.  All razors can be stored in the checked bags.

Disposable razors and razors with cartridges can be stored in your carry on bag. Just make sure that the sharp parts are covered to avoid injury.

A straight razor has to be stored in the checked bags and is not permitted in a carry on bag.

Safety razor blades have to be removed and stored in the check bags. They can be stored in the carry on bag without the blade only.

Electric razors are permitted in the carry on bag with batteries or battery pack.