Doctype stands for Document Type Declaration. It informs the web browser about the type and version of HTML used in building the web document. This helps the browser to handle and load it properly.
While the HTML syntax for this statement is somewhat simple, you must note each version of HTML has its own rules.
Yes, the doctype or DTD tag is important as it informs the browser which version of HTML it is parsing. Without a DTD or doctype tag the browser has to apply its best guess, which may result in the page not displaying as the author intended.
Yes. It is important to write this in the beginning of the HTML code because it tells the browser that the code is regarding HTML so the browser will be known that the code is of HTML and it will execute the code. Instead of you will not write this code the browser has to understand that the course is regarding which program.