From 1 to 100
5,15,25,35,45,55,65,75,85,95 Among these ten 5's are in units place
50,51,52,53,54,55,56,57,58,59 Among these ten 5's are in tens place
so ten 5's in units place + ten 5's in tens place = 20 times
=> from 1 to 1000 the number of times the digit 5 appears =
20 * 10 = 200 times
=> from 500 to 600 the number of times the digit 5 appears= 100 times
then total number of times 5 appears from 1 to 1000=
200+ 100 = 300 times
Hence 300 is the right answer