"Did the novelist, Ernest Hemingway, once live here?" is as correct, grammatically, as "Did the novelist Ernest Hemingway once live here?"
In the second question you make it clear that the novelist you are referring to is H. because the listener may not be aware of it, so you use no commas. It...