Valmiki did not write Ramayan, he NARRATED it ... he was alive during the time of Ramayan, in fact Ram's sons - Luv and Kush were born in his ashrama , the Sage Valmiki met Ram, Sita, Hanuman - all the characters ...
Plus the proof of ram is all over India in the form of geographically annotated places like Ayodhya, Chitrakoot, Kishkinda, Rameswaram ...
(even Ram Setu - you should refer to the report by Geological Survey of India, which was presented before Madras High Court and it ruled that Ram Setu was man-made, in the Supreme Court WITHOUT ANY EXCAVATIONS, the ASI said it was natural - thus the controversy - anyway, new excavations will take place and the truth will prevail)
But since these events took place 6500 years ago (yes, recent astronomical studies pin-point the exact dates) people started identifying these as mythology more than History !
do u know there is a great controversy whether Jesus was born on 1 AD or 4 AD (So the farther back u go, the more blurred the details become)
But that does not take away the historicity of Ramayan or Mahabharat!