While everyone who buys books has a good reading habit, not all library visitors may be book buyers.
The conclusion is invalid because there might be other reasons why someone visits the library, unrelated to buying books.
In logical inference problems, carefully distinguish between necessary and sufficient conditions before drawing conclusions.