This is the kind of a question that would require a book to answer properly, but I will take a stab at it. I apologize in advance for the length of my reply. Most of this response was written as a series of articles meant for another venue and so I am not sure that this flows all that well either, and for that I also apologize.
I think that the terms 'offshore' and 'coastal' get bandied about quite freely without any real thought about what the differences are. Even the term ‘race boat’ is a bit vague since all kinds of boats are raced in all kinds of differing types of competition. Race boats can therefore vary quite widely depending on the type of racing that they are intended for. I am assuming that you are not asking about small one design race boats as much as boats that at least to one extent or another can be raced or cruised in a pinch.
For the most part, race boats are optimized to perform better than the racing rating rule under which it is intended to race. This has a lot of implications. Under some rules (IMS and IRC for example) race boats are optimized to be fast and easy to handle across a wide range of conditions, producing great all around boats, but in the worst cases (International, Universal, CCA and IOR rules for example), the shape of the hulls, and design of the rig are greatly distorted to beat the shortcomings and loopholes in the rule, producing boats that become obsolete as race boats, and to a great extent as cruising boats as well, once the rule becomes history.
While the EU does have a system that certifies boats into one of 4 categories, this rating system was intended to remove trade barriers between the various EU countries. It represents the lowest common denominator between all of the regulations that pre-existed the formation of the EU. A boat that is certified as meeting the CE Small Craft Directive, in the offshore category, has met this minimum standard but it does not certify that the vessel is actually suitable for offshore use. For example the EU standards do not look at motion comfort, or the suitability of the interior layout for offshore use. Stripped out racers with minimal tankage and fragile rigs can and do obtain offshore certification. The U.S. does have the ORC, ABS, and ABYC standards which are somewhat helpful, but again does not certify that the vessel is actually suitable for offshore use
In a broad terms, a well made coastal cruiser should be more expensive than a dedicated offshore distance cruising boat, because it needs to be more complex and actually needs more sophisticated engineering and construction than most people will accept in a dedicated offshore boat. When new, the high tech materials used, and the first class hardware generally employed, make racers comparatively expensive as well. They are also expensive to maintain in full race condition since maintaining a smooth, fair bottom, good sails, running rigging. and sophisticated electronics does not come cheaply. But as they grow older and less competitive, they often become real bargains.
In a general sense, all boats are a compromise and with experience you learn which compromises make sense for your own needs and budget. Most times the difference between an optimized race boat, coastal cruiser and a dedicated offshore cruising boat is found in the collection of subtle choices that make a boat biased toward one use or the other. A well designed and constructed coastal cruiser will often make a reasonable offshore cruising boat and club level racer, while traditional dedicated offshore cruising boats usually make very poor racers or coastal cruisers.
Which brings up another key point. I would think that most knowledgeable sailors use the term ‘offshore cruiser’, they generally think of traditional, long waterline, full keeled or long fin keeled, heavy displacement, cutters or ketches. But in recent years there has been a whole series of ‘modern offshore cruisers’, which have been designed to take advantage of the research into stability, motion comfort, performance, and heavy weather sail handling that emerged as the result of the Fastnet and subsequent disasters. These boats tend to be longer for their displacement, often have fin or bulb keels, and carry a variety of contemporary rigs such as fractionally rigged sloop rigs. Depending on the specifics of the boat in question, a race boat may also make a reasonable coastal cruiser or offshore cruiser but will rarely be ideal as either and will generally take some adaptation to reach a reasonable standard for these applications.
Looking further, when I think of the distinctions between a raceboat, vs. coastal cruiser vs. a dedicated offshore boat, there are specific attributes that I would look for: