TLDR;.
Why would users only want to go back to the first page from the last page? The chance is (statistically) bigger that they want that from any other page. Most users hopefully won’t even go to the last page. Allow users to always navigate back to page one and hide or disable the “next” button on the last page.
In a book it is easy to find the first, last, next and previous page but any other page requires a bit of searching through it. A minimal pagination allows exactly that and shows the page you are on and how many there are.
Minimal pagination controls:
[1] … [4] 5 [6] … [10]
For the above concept users have to think in terms of page numbers. To allow thinking only in terms of previous next, first and last page and make navigating a bit easier, many pagination designs introduce buttons for that:
[first] [previous] page 5 out of 10 [next] [last]
But that introduced the problem that when you are on the last page, what to do with the "next" and "last" page buttons. Obviously the same counts for the "previous" and "first" button on the first page. I don’t know where the idea of looping came from but that has been copied and become an often used concept as well. There are three reasons not to use it:
- It doesn’t communicate the concept of looping
- It duplicates a button that is already there (navigating to the first/last page)
- It changes the meaning and behaviour of previous/next
So what to do with the "next" and "last" buttons on the last page? On the pages where they are not needed you can hide or remove them. Another option is to disable them. For that you have to be sure they really look disabled.
Disabled buttons are often used to prevent shifting of buttons; When you start on the first page without "previous" and "first" they would suddenly appear when you click "next" which would shift that button and disallow you to quickly click "next" again on the same spot. With good design and implementation this problem can easily be avoided.
Also disabled buttons are used to not surprise people with appearing and disappearing buttons but I don’t know if that is even relevant. My guess is that it doesn’t really matter as pagination is so common, people should have no trouble understanding how it works.
For a clean design I think omitting the buttons is fine, also because I don’t like disabling things in general. So you only need this:
page 1 out of 10 [next] [last]
And:
[first] [previous] page 10 out of 10
Just position it correctly so it doesn’t shift. And obviously, instead of the words you can use arrows like: [|<] [<] [>] [>|]
Also you can omit the “last” and/or “first” button if you don’t see people ever use it, which will most likely be sooner the case for “last” than for “first”. But therefore you have to add them first and see what analytics have to say about the click rate after a while.