Lube oil is used in diesel engines:

To ignite

To cool the engine

2 and 3 both

To reduce friction