So, what's to do?

It's White to move and draw the game. What must White do?

You must provide proof for your claim of what's to be done by any reasonable means. No looking up the solution please!

Nikita M. Plaksinm Shakhmaty v SSSR in 1980

In my first answer I proved that White is lost without further assumptions, by showing an example of a game where this position is reached and White is indeed 100% lost.

White can castle. Credits to @edderiofer for this idea (further validated by the OP who confirmed that it was the intended lateral-thinking part).
I will here prove that if White can castle, then the last 49 and a half moves contained no pawn moves or captures, and hence all White needs to do is castle (for the sake of it) AND claim a draw by the 50-move rule. Moreover, 49.5 is actually achievable, which I show by an example.

First, a couple of observations regarding where the pieces currently on the board must come from:

$$\bullet$$ The rook on a1 has never moved since castling is still possible. We will see later that the other white rook cannot come from a pawn promotion, and hence it comes from h1.
$$\bullet$$ The amount of pawn captures by Black equals the amount of missing White pieces, so every missing piece was captured by a pawn.
$$\bullet$$ White made no captures, so the Black b4 pawn could come past the White b pawn only by making a capture.
$$\bullet$$ Assume that the Black h pawn made a capture to come to g6 and is still there right now. Then there is no way that the Black light square bishop could ever come where it is as the Black h pawn would have constantly blocked the way. Therefore the pawn on f5 comes from h7 and made the other two captures.
$$\bullet$$ The White a pawn was not captured, since we just made a list of all captures that occurred and it’s not in it. Therefore it disappeared by being promoted (possibly into the knight that is still on the board, or into a piece that got captured – these are the only options: it cannot be the bishop, because to escape, the bishop would need Black b6 to be played, and then the black knight would have no way to come to a8).

When the black dark square bishop gets out of initial position:

$$\bullet$$ Black’s g6 pawn is in position (to let the bishop out)
$$\bullet$$ Black’s f5 pawn is in position (as this must be done before g6 is played)
$$\bullet$$ The pieces at g8 and h8 are in position (this must be done before g6 is played)
$$\bullet$$ The black knight at h4 is in position (as it must be done before g6 and gxf5 are played)
$$\bullet$$ b6 was played (to unlock the bishop now on g8)
$$\bullet$$ the pieces at a8 and b8 are in position (must happen before b6 is played)
$$\bullet$$ the a pawn promotion by White has occurred (must happen before Na8 and b6)
$$\bullet$$ axb4 was played (must happen to let the White a pawn walk to promotion)
$$\bullet$$ White b5 was played (must happen before axb4)

When the white h rook gets out of position

(which it must do at some point, because even if it was captured, it must have been by a pawn, far from its initial position)
$$\bullet$$ White’s light square bishop has left
$$\bullet$$ e3 was played (to allow the bishop out)
$$\bullet$$ f4 was played (only way out for the rook)

-----Therefore-----

If you assume that the white h1 rook gets out of initial position before the black dark square bishop does, then the white pawns and black knight block the way for the bishop to get to g3. It follows that the rook gets out last, after all other pieces are in/near their final position.

When this happens, the rook only has a 1-dimensional corridor in which it can move, blocked by bordered by the pawns and knights. Problem: it needs to let the other two rooks get past it. For this, it needs to exit the corridor, let the two rooks in, and get back in.
The bishops move back and forth like doors, and the black king has a little dance of its own to avoid blocking the way.

The example below is optimal.

You can check easily that White makes no waiting moves as its rook gets out (moves 48 to 59) and in the second phase Black makes no waiting move as its pieces get into position. Hence 49 and a half is the exact minimum number of moves that happened between the current position and the last capture/push of a pawn.

PGN: 1. b4 a5 2. b5 Nc6 3. Nc3 Ne5 4. Nd5 Ng6 5. Nb4 axb4 6. a4 Ra6 7. a5 Re6 8. a6 Nh4 9. a7 Nf6 10. a8=Q Nd5 11. e3 Nb6 12. Qa3 Na8 13. Qg4 Rf6 14. Qg6 hxg6 15. Qd3 Re6 16. Qf5 gxf5 17. Bb2 Rhh6 18. Bd4 Re4 19. Ba7 Rhe6 20. Bb8 b6 21. Bc4 Bb7 22. Bb3 Bd5 23. Ba4 Bc4 24. Nf3 Be2 25. Nd4 Bh5 26. Nc6 Bg6 27. Ne5 Bh7 28. Ng6 Bg8 29. Nh8 g6 30. Rf1 Bh6 31. h3 Bf4 32. Ba7 Bh2 33. f3 Qb8 34. Bb3 Qb7 35. Ba4 Qd5 36. Rf2 Kf8 37. Rf1 Kg7 38. Rf2 Kf6 39. Bb3 Qd4 40. Ba2 Rc6 41. Rf1 Qe5 42. Rf2 Rec4 43. Bb1 Rc3 44. Rf1 Ra3 45. Rf2 Rcc3 46. Rf1 Rab3 47. f4 Rd3 48. Rf3 Rdc3 49. Rg3 Rd3 50. Rg5 Rdc3 51. Rh5 Rd3 52. Rh7 Rdc3 53. Rg7 Bh7 54. Rg8 Rd3 55. Rb8 Rdc3 56. Rb7 Rd3 57. Bb8 Rdc3 58. Rba7 Rd3 59. R7a2 Ra3 60. Rb2 Ra7 61. Rba2 Rb7 62. Ba7 Rb8 63. Rb2 Rg8 64. Bb8 Ra3 65. Rba2 Ra7 66. Ra6 Rg7 67. R6a2 Rb7 68. Ba7 Rb8 69. Ra4 Bg8 70. R4a2 Rh7 71. Ra3 Rh5 72. R3a2 Bh7 73. Ra3 Rg8 74. Bb8 Rg5 75. Ra7 Rg7 76. Rb7 Rg3 77. Ba7 Rf3 78. Rb8 Bg8 79. Rf8 Rh7 80. Rb8 Rh5 81. Ba2 Rf2 82. Bb3 Rg5 83. Ba4 Bh7 84. Rg8 Rg3 85. Rg7 Bg8 86. Rh7 Rgf3 87. Rh6 Kg7 88. Bb8 Kf8 89. Ba7 Ke8 90. Bb8 Kd8 91. Rh7 Kc8 92. Rg7 Bh7 93. Ba7 Kb7 94. Rg8 Qg7 95. Rf8 Bg8 96. Bb8 Bg3

White

is doomed (or are they?).

Here is why:

White is under the threat of mate in 1 by the Queen (Qxa1#), and independently a forced mate in 2 by the rooks (Rxg2+ followed by Rf1#). The only move to prevent both is c3, which makes room for the king to escape the rooks and simultaneously blocks the queen's diagonal. Note that even if queenside castling was still allowed, it is of no help against Queen move to a1. So we have 1. c3!? but then Black finds a nice rook sacrifice: 1. ... Rxd2+!!, removing the defender of the c3 pawn to allow the queen to enter the game. 2. Kxd2 Qxc3

From here, either 3. Ke2 Rf2+ 4. Kd1 Qd2#, or 3. Kd1 Rf1+ 4. Ke2 Rf2+ 5. Kd1 Qd2#.

However (!)

There is the tag, by which we could infer that something from the last few moves can be deduced. In fact, few of the Black pieces may have made the last move: the queen and the bishops [the knights can't come from anywhere and the pawns can't have made the last move because they must have been in this position already before the 8th row could be set up, see an example below.]. Still the exact last move seems unlikely to be uniquely defined. However, we know that there is a solution and therefore it must be that the same position was repeated twice already and White is one move away from repeating it a third time. Either that, or White can draw by the 50 moves rule.

EDIT

From Rewan's comments I thought at first that it was in fact possible to prove that the 50 move rule can be applied, so that the answer would be that what White needs to do is to simply claim a draw. It seemed likely that something of the sort could be true, because if we look at how the position could arise, it comes with great constraints (especially in getting the 8th row in order). However, here is a proof that it is not the case: it is possible to reach the position in hardly more than 50 moves, and where the longest run of moves with no pieces taken or no pawns pushed is 10 (a long way below the required 50).

PGN: 1. Nc3 a6 2. b4 Nc6 3. b5 Ne5 4. Ba3 a5 5. Bc5 Ra6 6. Ba7 Rh6 7. Nd5 Nc4 8. Bb8 Nb6 9. Nb4 axb4 10. a4 Nf6 11. a5 Nfd5 12. a6 Nf6 13. a7 Nfd5 14. a8=Q Nf4 15. Qa3 Na8 16. Qg3 b6 17. Qg6 hxg6 18. Ra3 Rh3 19. Rg3 Bb7 20. Rg5 R8h4 21. Rh5 Be4 22. Qa1 Qc8 23. Qc3 Qa6 24. Qe5 Qa3 25. Qf5 gxf5 26. Rh8 Bf3 27. e3 Bh5 28. Nf3 Bg6 29. Ne5 Bh7 30. Ng6 Rh5 31. Rg8 R3h4 32. Nh8 g6 33. Bc4 Kd8 34. f3 Kc8 35. Bb3 Kb7 36. Ba4 Bh6 37. Rf8 Bg8 38. Kf2 Qc3 39. Ra1 Qg7 40. Ke1 Nd3+ 41. Ke2 Ne5 42. Ke1 Bf4 43. h3 Bh2 44. f4 Rg4 45. Kf1 Rg3 46. Ke1 Rf3 47. Kd1 Rf2 48. Ke1 Rh4 49. Kd1 Rg4 50. Ke1 Rg3 51. Kd1 Nf3 52. Kc1 Nh4 53. Kd1 Rgf3 54. Ke1 Bg3

Also note that no position is reached twice in this sequence, therefore the three move rule doesn't apply either. Conclusion: unless we use an argument such as "we are told that there is a solution", it is impossible to prove that White can force a draw (in the example above, White cannot force a draw).

• @RewanDemontay Yes, I'm making an edit right now. – Arnaud Mortier Aug 22 '19 at 23:14
• @RewanDemontay Is there yet something more that I'm missing? – Arnaud Mortier Aug 22 '19 at 23:22
• @RewanDemontay Wow, ok. That's a cool puzzle. – Arnaud Mortier Aug 22 '19 at 23:31
• Wouldn't rot13(nsgre 1. p3, Ekq3 (sbepvat juvgr gb gnxr gur ebbx be zngr va gjb) 2. kr3, Dkp3! 3. Xq1, Es1#) be better? @Shinjo what was wrong with rot13(Dkn1)? – Abbas Aug 23 '19 at 8:55
• @Abbas It's not cool to torture your opponent by showing off how many ways you have to extract every bone from his king's body :) – Arnaud Mortier Aug 23 '19 at 11:49

EDITED after ~15 hours.

As Amaud Mortier points out in their answer, without anything "weird" going on, White is losing. The only remaining hope for White to draw is to claim a draw by threefold repetition or the fifty-move rule. But it's impossible to prove the former is possible, and the latter seems to be outright impossible to prove too, since Amaud has provided a game that goes nowhere near the 50-move limit that ends in this position...

However, since this is a puzzle:

Castling is always assumed to be possible unless it's provably impossible. With that in mind, what happens if White plays O-O-O? Perhaps, by forcing castling to have been possible, we can force the game to have taken 49 non-pawn moves before this position, and immediately claim a draw before Qa1#?

Let's examine how the position in the diagram above arose (incomplete):

We first note that White is missing a knight, a queen, and a pawn. We also note that Black is missing nothing. Black has also made at least three pawn captures (by the pawns on b4, b6, f5, and g6), so Black has made exactly three pawn captures, and White has made no pawn captures since Black is missing nothing. This accounts for all the pieces on the board.

The next question is, how did Black's bishop get to g8? Since Black has not promoted any pieces, as all eight of their pawns are on the board, the bishop must have come in via Bh7-Bg8, and then a pawn must have gotten to g6. The only place for such a pawn to have come from without blocking the bishop first is g7, so the pawn on f5 must have come from h7. So the move sequence must have been, in some order, h7xg6, g6xf5, Bh5, Bg6, Bh7, Bg8, g6.

How did White's bishop get to b8? Since White has not captured, any promotion of the missing a-pawn must have been on a8, so the bishop on b8 cannot be a promoted bishop; it must be the original bishop from c1. By a similar logic to the above, the moves in this area must have been Ba7, Bb8, b6. So the pawn at b4 has made Black's third capture. Further, this move sequence must have occurred before Black moved their light-square bishop.

Note also that in both corners on the 8th rank, there are hemmed-in knights. These must have gotten there before b6 and g6 were pushed. So we must have had, in roughly this order: Ba7, Bb8, Na1, b6, h7xg6, g6xf5, Bh5, Bg6, Bh7, Bg8, Nh8, g6.

For the white pawn at b5 to get where it is, it must have moved to b5 first, then Black must have captured at b4. Now, this means that although White's a-pawn was missing, it cannot have been captured on the a-file. Therefore, it must have promoted.. For it to have promoted, the a-file had to have been clear, so it had to have promoted after the capture at b4 but before the knight moved to a8 (and thus before the move b6); it can only therefore have been captured on f5 or g6 by the h-pawn, if at all.

White's rook, in order to have escaped to be captured or to end up on f8, must have passed through f1 and f3 (since we are assuming that White can castle), so f4 must have been played before this; similarly, White's bishop must have passed through e2, so e3 must have been played before this.

Which pawn moved last, and was it before or after the last capture? The last capture was made by either the b4 or f5 pawn, after which g6 was played, the last pawn move must have occurred after the last capture. It cannot have been to a8, b4, b5, b6, or f5 from the reasons above, as these moves all occurred before g6. Other than the stationary pawns that have never moved, the only remaining candidates are the moves g6, e3, f4, and h3.

Let's turn to the black bishop at g3. It can only have moved where it is after Black played g6. However, the whole configuration on the right-hand-side of the board seems pretty locked-up; Black's knight has nowhere to go, Black's rooks can't move without retro-checking White, and even if they weren't there, Black couldn't move the knight without retro-checking White either. We can only conclude that Black's knight has to have gotten to its current position via either f5 or g6.

What remains to be proven:

That if White can castle, there must have been 49 moves prior to the current move.

That there is a game that ends in this position where White can indeed castle (i.e. that one cannot disprove that White can castle).

• Following that advice by Rewan, I tried to prove that the 50 moves rule applies, but it doesn't (I included a way to arrive at this position in my answer). – Arnaud Mortier Aug 23 '19 at 13:58
• I see what you're getting at now. I've edited my answer to include the possibility I suspect you're referring to, but my retrograde analysis skills aren't good enough to push the whole thing through. – edderiofer Aug 24 '19 at 0:48