As I sometimes do, I guested into a friend’s online copyediting course as a grammar expert for a week recently. One of the questions I answered was about whether “If you like” is acceptable on its own in any context. The questioner felt that in a conversational context it was acceptable (“Shall we leave at noon?” “If you like.”). Another student said that it doesn’t work because there’s an if but not a then. I said the following:
There are a few important things to remember.
First is that there are many kinds of English, suited for many different situations. To insist on standard formal English in all contexts is like wearing formal wear every day all the time. To use formal English in colloquial contexts doesn’t bespeak class and elegance; it bespeaks tone-deafness and rigidity. Rules are made to serve communication, not vice versa. Get to know the kind of English that is expected and used in each context you’re writing for. The point of editing is to make sure that the text produces the desired effect on the readers. Your job as an editor is to minimize the impedance in the circuit between author and audience. This often involves fixing infractions of rules, but not always. Indeed, sometimes the way to signal the tone of the text is to break a formal rule.
Second is that even in formal standard English, there are many things that are matters of preference, not rules.
Third is that not everything you do with language is a matter of grammar. Spelling mistakes, for instance, are not grammar errors. Neither are malapropisms. They’re errors, but they’re different kinds of errors (and in fact are the kind you can make sure to fix everywhere regardless of the tone and audience).
So, for instance, if as in “I want to know if you’re in town” is not a bad habit you need to cure yourself of for once and for all. The colloquial use of it where whether is the formal standard is very well established, and for some texts using if in place of whether will be the sort of little adjustment you can make to make it seem more relaxed. Bear in mind that “If you’re in town, I want to know” is acceptable even formally (the then can be and often is left out), which means that in the same sense, “I want to know if you’re in town” is also formally acceptable to mean “Let me know in the case that you are in town.” This, I believe, is why it has come to be used in the other sense, “Let me know whether you are in town or not.”
A very common mistake made by people who are eager to be right about grammar is to infer an absolute rule from one case, or to take a rule as learned overtly and apply it too broadly, declaring many common usages to be wrong because they don’t fit it. This is like pulling out a field guide to birds, looking at the picture of a magpie, deciding that all magpies must exactly resemble the exact specific colouring of that picture, and declaring any that don’t not to be magpies (and perhaps repainting or just killing them).
The effective approach is to read widely, see what kind of usages are common in what kind of contexts, and figure out the real rules on that basis. Often the real rule is not so simple and clean-cut; some things that are perfectly standard formal English still provoke arguments among linguists as to their actual grammatical structure.
To address a specific question: “If you like” by itself is a “sentence fragment” because it uses a subordinating conjunction (“If”) without a main clause to be subordinate to. But that doesn’t mean it can’t be used; we use sentence fragments all the time (I won’t say “The more, the merrier,” but if I did, it wouldn’t have a verb!). Only in the starchiest of contexts is it necessary to avoid starting sentences with conjunctions such as But and And, and in those cases only because some people in the past decided to repaint the magpies. In conversation, it is quite normal to leave out established material, especially in responses: “Shall I join you?” “[You can join me] If you like.” In more formal texts, where it is a monologue, not a dialogue, and is expected to convey clearly the logical connection, you would just use a single full sentence: “You can join me if you like.” (I’m not going to wander into the can/may argument here, but here is a full article on things many people think are errors that aren’t: sesquiotic.wordpress.com/2008/12/04/when-an-error-isnt/)
An important step on the way to being an expert user of the language is to read authors you respect in as many different genres as possible. Learning cut-and-dried rules and trying to apply them as broadly as possible won’t make you an expert user; in fact, you risk destroying your ear for the language. You need to be able to hear and read it as your readers will. You won’t be in a position to give them lessons in how to hear it the way you’ve learned to.