The more I write my own work, the more I realized how the earliest stories that I love affected me.
The very first true SF that I loved was Robert Heinlein's Future History stories, especially the Green Hills of Earth. Heinlein veered in some strange directions later in his career but his short stories are still wonderful.
I also found Isaac Asimov in my high school library and while I didn't connect to his Foundation series, I loved the Robot stories and still do. That led me to getting a subscription to Asimov's magazine, truly a gold-mine for a kid growing up in rural New England. I first read David Brin's The Postman short stories in Asimov, first read Connie Willis there, and loved S.P. Somtow's time travel and then alternate Roman history stories with Aquila.
On the less scientific side, I got a copy of Anne McCaffrey's The Dragonriders of Pern omnibus when I joined the old SF mail order book club. It still has the Cheetos stains on it.
And on the fantasy side, there was, of course, The Lord of the Rings, which inspired my first fan fiction, before it was called fan fiction. There was also Mary Stewart's Merlin trilogy, a story so good that it influences Arthurian fiction today.
What are your favorites?