This is a mis-named movie, The title refers to the seminal 1954 science fiction novel by Richard Matheson, but in fact the film itself is more or less a remake of "The Omega Man" (1971) itself a heavily re-written adaptation of the above book.
What unites both films is the strength of the core performance, Cinema's eternal rugged individualist Charlton Heston was born to play the Last Man on Earth, Will Smith cast in the same role opts to do about five variants on the pain of irreparable isolation. It is a great acting job to say the least that deftly elevates what is in the end, mediocre material.
The credits give screenplay props to John and Joyce Corrington, who adapted "I Am Legend" in 1971 turning it into "The Omega Man" for better or worse, turning protagonist Robert Neville into an US Army germ warfare expert and de-emphasizing the obivous vampirism of the infected remnants of humanity.
Hope they got a nice check for their troubles.
Meanwhile the current film is well worth seeing, mostly because Will Smith really is that good.