Wow nice and not easy too.
The first ever published chess puzzle

It's very unlikely that this was the first "published" chess puzzle, since we still have problem compositions from many early Islamic masters such as al-Adli and as-Suli. Plus there are compositions in the printed works of Lucena, Polerio, Damiano...perhaps this was the first puzzle printed in a newspaper, but the history of recording chess problems goes back at least a thousand years before your example.
It is not the first published chess puzzle or problem. In fact, "Das Indische Problem" by Kohtz and Kockelhorn lists some of the other problemists of the 1840s as an introduction to the famous Indian.
A problem of Anderssen's is given as a precursor to the Indian, the mate, as delivered by the king here is known as "Anderssen's mate":
It is not the first published chess puzzle or problem. In fact, "Das Indische Problem" by Kohtz and Kockelhorn lists some of the other problemists of the 1840s as an introduction to the famous Indian.
A problem of Anderssen's is given as a precursor to the Indian, the mate, as delivered by the king here is known as "Anderssen's mate":
A very nice problem but I couldn't make out who was going in which direction, i.e. is the black pawn on h2 or a7? A grid would have helped.

In chess diagrams, the bottom is always the white side of the board and the top is always the black side. Therefore, black pawns are always coming down and white pawns are always going up.

This problem is old but I looked in my copies and it was published in Vol VII in 1846 by Staunton. The same year the problem was published in the French Chess paper La Palamède, edited by St. Amant. In the French version it was missing the pawn on b5 and was considered the better of the two.
According to Murray the oldest published problem is the Dilaram problem and is somewhere around 600 AD.
(SPOILER) You can read more here http://moonsighting.com/chess/dilaram.html
NOT and advertisment, nor my site. (SPOILER)
Also I have posted an updated version of it here. I had to update the bishop (elephant) and move the knight to make it work because in the older version of Chess the bishop moved two spaces diagonally and could jump pieces. Hope you enjoy.
White to move. Mate in 5.
This was first ever published chess puzzle! This puzzle was called "Indian problem."
It was printed in The Chess Player's Chronicle, in 1845. Can you solve it?