when u click back button, use viewPager.setCurrentItem(viewPager.getCurrentItemPosition()-1);
when u click next arrow, use viewPager.setCurrentItem(viewPager.getCurrentItemPosition()+1);
and in onPageChangeListener, check the current page number.If its 0, set the visibility of back arrow to GONE, else set its visibility to VISIBLE
if the page is last page, set the visibility o fnext arrow to GONE, else set its visibility to VISIBLE