As Barnes comments, Job having brought himself almost to the point of belief in an afterlife, now checks himself. Still he is unsure; still the future work of God is unclear to him, yet he wants to have hope.
This is where the hope of every believer should be focused, and we have much clearer light on the nature of this hope than Job. For some, life is too pleasant and they are tempted to wish to stay here for ever. For others life is filled with more or less trials and they serve to wean us from this world. For both there are cycles to be experienced and periods of joy interspersed with periods of trial. God allocates each to us according to his perfect wisdom, and by these prepares each one for the eternity.