How are lysosomes formed?
Cells take up external material in the process pf phagocytosis. This involves creating a vesicle from plasma membrane that will contain the external material. The vesicle enters the cytoplasm where it is called (early) endosome. The cellular membrane components of this endosome are recycled and gave back to the plasma membrane. The endosome pH decreases and it is now called late endosome.

Meanwhile, peptides (which will form the future hydrolases) are produced in the ribosomes of the endoplasmic reticulum and mannose 6-phosphate is added to these peptides. They are further transported to the Golgi apparatus which "packs" them into lysosomal vesicles.

The lysosomal vesicles fuse with a late endosome and due to the acidic medium of the endosome, the peptides dissociate from mannose 6-phosphate. This process turns the late endosome into a mature lysosome that is capable to digest material taken up via endocytosis.


  My book wrote: lysosomes are formed from ER or golgibodies.


ER and Golgi help supply the enzymes to endosomes, thus turning them into lysosomes.



References:


Wikipedia contributors, "Lysosome," Wikipedia, The Free Encyclopedia, http://en.wikipedia.org/w/index.php?title=Lysosome&amp;oldid=635272974 (accessed November 30, 2014).
Cooper GM. The Cell: A Molecular Approach. 2nd edition. Sunderland (MA): Sinauer Associates; 2000. Lysosomes. Available from: http://www.ncbi.nlm.nih.gov/books/NBK9953/