Object distance, u = -40cm
Image distance, v = 40 cm
Using lens formula,
1/f=1/v-1/u=1/40-1(-40)
or Focal length,
f=+20cm
The positive sign of focal length shows that it is a convex lens.
Now,
Magnification, m = v/u= 40/(-40)= -1
Thus, the image is real, inverted and same size as object.
If candle flame is shifted 25 cm towards the lens, then
Thus the image will be virtual, erect and enlarged.
For this, you can refer to the following diagram,