Let me give another clear answer with steps. It is based on this you tube video
I updated Samsung J5 to Marshmallow but there was problem then I did a factory reset to make it right but after reset it asks me to enter your previous e-mail and password. Well ,this phone belongs to my father. He didn't know password .Then I searched on Google and finally found a solution.Key steps are:
Download Odin software from here
Download Samsung J5 firmware.You have to download firmware whose date is before September 2015, from here
Download Bypass app
OTG cable is required.
After downloading these three, grab your phone. Power it off then after few seconds press Vol down+ home button+ power button. After this a caution sign will appear,press Vol up button.Now your phone will go in downloading mode.
Connect your phone to PC via data cable,now launch Odin software on PC and click on AP
button and select firmware which you have downloaded.It will say you to wait...then a message will appear as "Leave CS
". When message appears ,click on start button. Firmware will now install to your phone,you will see loading line on phone and PC.When it completed android icon appears on phone. Now,remove data cable,after few seconds your phone will switch on.Now press few next button or skip them.When you reach on "verify your account" it will ask you to enter your e-mail.Since we *don't have email or password save Bypass app in a USB and connect OTG cable to your mobile,after connecting OTG you will see that phone file manager will open USB on phone, install Bypass app (enable app install from unknown sources).Open this app,now you have access to settings, there go to factory reset and perform reset.Your phone will restart.Finally Google verify account has removed,after few steps your phone will switch on again.
Note :
Every thing works fine except two things:
Skype app does not connect to server network
You will not be able to do Software update