MDF is medium density fiberboard. Essentially it is glue and sawdust compressed under great pressure to make a sheet like plywood. It cannot handle moisture. It swells wildly. It is very smooth and flat and makes good molding, easy to paint. Many houses are now built using it for all manner of painted trim. Another downside is that it is pretty heavy, a 3/4" thick 4'x8' running upwards of 115#'s!
As for using the router, yes, it is an ideal tool for MDF. But a couple of things. You will mkae lots of dust, dust that is harmful to breath. Respiratory protection is a must. If you have no experience with a router, this is not a bad place to start. May I suggest a good router book to begin?
I used to teach woodworking, in a community college system, in my own shop, and around the country at woodworking shows. So I have a bias, for what it's worth. But I still think a book on routing called Router Joinery Workshop is the best one out there. But I am a little prejudiced. I know the author rather well.
For your purposes, look in the book at making molding. Good info there for what you are planning. Oh, and look at it BEFORE you buy a router.
Any questions can be posted here. I check regularly.
When you do cut and rout MDF, sand the cut edges and seal with shellac before you paint. Looks better.