How to reference categories table in products table?
I see from your diagram and from the columns named lft and rgt that you are using the nested sets technique for organizing the categories into a tree.  So far so good.  

Now all you need to do is add a foreign key to the products table that references category id in the categories table.  You might as well call it "category_id", same as the column it references.  The benefit of declaring it as a foreign key is that the DBMS will now prevent the introduction of products with an invalid category_id.  It's up to you in the application to provide a valid category_id at product insert time.

All of this is very elementary relational database design.  If it's covering material you already know, then please reword the question to make it clear just where you need an answer.