I came across this image when researching refraction in lenses. I can't understand why the light does not refract at the points which I have marked with burgundy arrows even though it is crossing a boundary between mediums or varying optical densities?
The diagram is misleading. In ray diagrams it is conventional to depict the lens as a plane perpendicular to the axis of the lens (in 2D, the vertical dotted line). Then rays only change direction when they meet such planes. It is also a convention to use the paraxial approximation so that all rays parallel to the axis are refracted through the forward focal point of the lens.
This illustration depicts the physical lens superposed on the ray diagram. Those are two separate ways of looking at the refraction of light through the lens.
In reality you are correct. Rays passing through the physical lens are refracted at both front and rear faces. For convex lenses, parallel rays further from the optical axis cross that axis before reaching the focal point.