The law of diminishing returns is related to the per-worker production function because it is, in essence, the flip side of that function.
The per-worker production function tells us how much a given worker can produce when given various amounts of capital with which to work. For example, let us imagine that I have a business in which I sew shirts. The per-worker production function will tell me how many shirts I can sew per unit of time if I have one sewing machine. It will also tell me how many shirts I could sew if I had two sewing machines and so on. In this case, we keep my labor constant and add (or subtract) capital and see how my production changes.
By contrast, with the law of diminishing returns, we are looking at the amount of output that can be produced when adding labor to a given amount of capital. Using the example of my sewing company, we are saying that I have a given number of sewing machines (and things like scissors and other tools) and that that cannot change. We then look at what will happen to output if I hire more and more workers. The law of diminishing returns tells us that I will get a lot more output at first but that I will get less marginal output as I add more workers.
Thus, these two are opposite to one another. In the per-worker production function, we vary the amount of capital and see how that affects the worker’s productivity. In the law of diminishing returns, we are varying the amount of labor and seeing how that affects output at a given level of capital.