A router is a dedicated routing device. It is designed and built for routing and just does that; probably very well. A layer-3 switch is first and formost a switch (layer 2 device) with added features to allow it to also make routing decisions for packets based on the information in the layer 3 header. A layer 3 switch, as long as it's good enough, will be able to perform the same routing functions as a router would; however you're less likely to get some of the wider set of features you'd find on a good router and you probably won't be able to get as wide a range of WAN circuit interfaces. And conversely you'll also be hard pressed to find a router with as many RJ45 ports as you'll get on a layer-3 switch
Also its worth noting that Layer 3 switches are much faster at routing then routers. THis is because they are able to perform the routing functions in hardware which makes it very close to wire speed routing.
Take a look at
Cisco article on the Layer2/Layer3 evolution.