It should work if you get the proper adapter. Here's a youtube video of an HTC One X with an adapter.
http://www.youtube.com/watch?v=hguyYmXrHVM
Just be aware that you want to find one that works with Motorola phones. I don't think there should be any issue just buying an adapter but just to be safe I'd look for one that is specifically for Motorola phones. You should be able to Google and find one pretty easy, or look on Amazon.com. The Razr M is still pretty new but there should be parts and accessories available for it.
I'm not sure how to best optimize the connection to an HDTV so you may need either a third party app or something depending on what you want to do. But Motorola phones are pretty good about having DLNA support to make it easy to connect to various other DLNA enabled devices. Be aware that each TV and phone may require slight adaptation to get it just right. Hopefully it'll be pretty straightforward for you though. If you run into trouble after getting the adapter just ask and someone here on the forum is sure to be able to help you. And of coarse you can google around to find "how to's" for a solution.
Amazon.com: MHL ATC - Simplay Labs Certified, Micro USB to HDMI MHL Adapter Cable in Retail Packaging (Sold Exclusively by Jonaca): Cell Phones & Accessories
This link ^^ is to one of the few adapters that cite support for a Motorola phone, but it's just the original Droid Razr so I'm not sure how well it would work with the Razr M. If you're going to be buying an adapter I'd definitely look for it to have support for at least one Motorola model, and the newer the better, and the closer to your model the better.