In the state I grew up in anyone getting a drivers licence before the age of 18 was required to take a 30 hour driver's ed course. There were no actual driving lessons involved with this course and I'm not even sure if the state strictly regulated what was supposed to be taught in the class, there was no sort of textbook and no sort of exam, the only requirement was that it had to be a 30 hour course taught by a certified instructor, or a 30 hour online torture session.
I'd imagine that right now the online course is the only option available but when I took it I was blessed to do it in person so when I was 15 I spent a week of my summer in a classroom sitting through one hour of learning road signs, an hour of learning car functionality, an hour of tricks to pass the state driving test, and twenty seven hours of pro-seatbelt propaganda. Luckily the teacher was quite entertaining and as I mentioned before there was no actual work we had to do in the class, most of the time was spent listening to his stories or watching videos that may have been on actual video cassettes.
I think there was only two pieces of paper that we even touched during that week, one was the certificate of completion and the other was what we wrote the answers to a quiz he gave out on. He gave the quiz on the second or third day of the class before lunch and he "graded" them while we ate and we went over the answers after lunch. One of the questions on the quiz he asked was, "Should the government require us to wear a seatbelt?" I guess it is also worth pointing out that I took this class within six months of my state requiring seatbelts (although if it was six months before or six months after I can't say). When he got to this question while reviewing the quiz with the class the teacher asked everyone who said no to raise their hand, nobody did. Upon seeing this he told us that one person in the class had answered no and kept waiting, shyly I then rose my hand and to my surprise the teacher told the class that I was the only person who had gotten that question right. But of course the law paid no attention to this teacher's or my opinion and it is illegal to drive without a seatbelt in almost all of the United States and much of the world.
The world has changed a lot since then, I doubt you'll find anyone who will be asking that question these days since many Americans have likely forgotten that there was a time not long ago when it was perfectly legal to drive without a seatbelt (of course it still wasn't the best idea). Now we all remember that we can be pulled over for not wearing our seat belt and newer cars often annoyingly beep at you until you put it on and some even newer cars have settings that won't let you shift out of park until you are wearing a seatbelt. So if we if we think about that a bit, your car knows when you are breaking the law.
But what else does your car know? You're not really endangering anyone else when you drive without a seatbelt (which is why it shouldn't be a crime) but you are when you're speeding, or when you're driving the wrong way on a one-way street or highway, and you especially are when you are driving under the influence. If your car is equipped with a navigation system it can tell when you're doing those first two things (your phone can too) and if you have a new car that can tell you things like when you are drifting out of your lane then those same sensors can be used to determine if you are driving drunk (or at least driving as bad as a drunk person). If your car has a dash-cam (which are uncommon here in the States but required in other parts of the world) then that video feed could be hooked up to a machine learning program that could read other traffic signs and determine when you are violating the regulations of those signs as well; in fact we no longer live in a world where this is all that far fetched, this software is already built into every Tesla and probably some other cars and frankly image recognition software like that isn't all that hard to make these days, I had an assignment to do this exact thing a few semesters ago. If you have a relatively modern car it knows (or at least has the ability to know) when you are breaking almost every traffic law on the books.
Now you could read all of this and be perfectly okay with it since your car isn't snitching on you or anything which is true now, but how long will it stay true? Every year auto manufacturers add more and more unnecessary features and among the most recent of these is the ability to connect to wifi. It is entirely possible that laws could be passed requiring car manufacturers to include RFID scanners in their cars which would scan your driver's license which would have an RFID chip built into it so that the car could record all your traffic violations and upload them to some server to be processed whenever you go home and your car connects to your home network, and even if you can't regularly park your car somewhere where it gets signal most states in the US and I'd imagine plenty of other places across the globe require cars to pass some sort of a smog check or other form of inspection, the data could be uploaded then. Such laws would make it impossible to avoid being fined for traffic violations of any kind since our driving would be tracked 1984 style.
Now of course while these sorts of things are interesting to think about it is important to realize that often times they will never happen. The possibilities I've talked about in this article are closer to science fiction than they are to ever becoming true. Putting this into law would be bad for the economy because all the people making payments on cars that became illegal would not want to pay them causing car dealerships and maybe even a few banks to go out of business, bad for the environment because it would sentence nearly every perfectly functional car on the road to the junkyard, and bad for politics because absolutely no middle or lower class citizen in their right mind would vote to reelect a politician who forced them to spend tens of thousands of dollars on a new car they didn't need. Plus it is a miracle that many "leaders" in governments all over the world even know how to use an iPhone so there are not enough of them who are familiar enough with technology to recognize that such a surveillance system is already possible. However the idea of self policing cars is still quite interesting and scary to think about, I would never be in favor of it as freedom should never be traded for safety.