I have a helmet cam. I also ride with a take-a-look mirror. When I see someone drive too close behind me I turn my head and look back and then they are on camera. If they are too close to me on the side I turn my head and they are on camera.
There are plenty of cheap action cams out there now, and even better values if you consider pre-owned. You could just buy a cheap inexpensive action cam and mount it facing backwards. If you fond it useful you can buy a better one later.
I tried a cheap rear facing action cam a couple of years ago and decied it wasn't worth it for me, although I live and ride in low-traffic areas.
I did catch this though...