As futurehog points out, defining science fiction is difficult, and the results are usually unsatisfactory. I think this is best seen by comparing some examples, Neal Stephenson's Cryptonomicon and Baroque cycle, Isaac Asimov's Foundation series, and George Lucas's Star Wars.

Regardless of your opinions of the relative merits of these works, I believe most readers would say that Neal Stephenson's books have the spirit of science fiction in them despite being historical, while Star Wars seems more like fantasy. Foundation is clearly classically "science fiction".

The node Defining science fiction makes the statement that "SF is the literary genre of the possible". Science fiction must be "speculative", and it should "result in a setting that is noticeably different from the reality we all know". Frederick Pohl calls it "the literature of change", while Damon Knight says it's "what we point to when we say it". Other definitions abound. All of these seem to lack some essence of science fiction.

I say, science fiction is about ideas.

Example 1: Neal Stephenson. Neither Cryptonomicon nor the Baroque Cycle occur in a noticeably different world -- one is set during World War Two and in the present, while the other occurs around the beginning of the scientific revolution. In fact, Stephenson has taken great pains to blend fiction and reality. Neither is there anything terribly speculative about them, unless you consider an island data haven mind-blowing enough to qualify. However, it is quite obvious on reading these books that the focus of them, the central characters, are ideas -- for Cryptonomicon, information, for the Baroque Cycle, money. This is what gives them the feel of science fiction.

Example 2: Foundation is "speculative" and very much set in the future. Even the Good Doctor didn't consider it possible, though. Psychohistory and FTL travel are in no way a seriously proposed future reality. They do qualify as ideas though, ideas that make an interesting story when combined with the downfall of a galactic civilization and an Encyclopedia...

Example 3: Like Foundation, Star Wars is hardly a serious future possibility. Unlike Foundation, its story rests on characters, Luke, Darth Vader, Leia, Han Solo, etc. A science fiction reader will notice (and possibly complain) about the way George Lucas hardly considers the society and surroundings of our heros and antagonists. This would be a mistake though, because Star Wars is not science fiction, it's mythology....

nasreddin points out that lots of things are about ideas, not just science fiction. I think the difference here is that while The Old Man and the Sea may be about ideas of honor and dignity, the focus is on the old man, not on his philosophy. Science fiction prizes ideas above all, sometimes to the point where story and characterization suffer for it (as critics enjoy pointing out). Besides, science fiction has crazy ideas that Hemmingway wouldn't touch with a ten foot pole.