I think they're about $165 at the dealer (from memory). You know FOR SURE yours is bad when you try to stop, almost stop, and then not stop.
Usually, your brake pedal will sink to the floor, and you may have to pump your brakes a few times to build enough pressure to stop the car.
There are other things you'll want to look for when troubleshooting though. For example, spongy brakes indicate air in your brake lines, or fluid at your wheels may be caused by busted brake lines or bad caliper.
If everything checks out OK, and you're having trouble stopping due to your pedal sinking to the floor, chances are that you've got a bad master cylinder.
It isn't difficult to install.