I am really curious in finding out how the Mars Rovers are maintained. The communications with the software could be done as long as there are no connection malfunctions, and I suppose they have a redundant connection with them, but hardware wise, is there any, and I mean any kind of maintenance performed on the rovers?
There's very little opportunity to do maintenance on Mars.
I could find an example of shaking the arm of Curiosity to get rid of dust. That's cleaning, and hence maintenance, for the purpose of avoiding cross contamination of samples.
A specialised dust cleaning device (a "wiper") did not end up going to Mars.
I could find no evidence of the Dust Removal Tool being used to clean the rover itself.
In general, Mars rovers just run until they break down.
Regarding the dust issue: much to the surprise of the early Mars scientists and rover teams, Mars takes care of the dust problem for us! Mars' typical weather generates these dust devils that whip through periodically and clean off the solar panels, thus giving new life to the rovers every time. This is useful for the landers and earlier rovers, but the newer Curiosity and Perseverance rovers both are nuclear powered via radioisotope thermoelectric generators or RTGs.
Other than that, there is no real way for these rovers to be maintained. You might be surprised to learn that for some of the earlier rover mission the baseline for nominal mission success is often only a few months of operation where they strive to achieve a few key science objectives. The Spirit and Opportunity rovers blew past those warranties though and lasted years thanks to the robust and over-engineered design. So typically speaking, the rover teams quite literally drive these things until they just can't go any further or until their power runs out.
If you'd like to read further, Emily Lakdawalla wrote an excellent book: The Design and Engineering of Curiosity.
The simple answer is, Mars rovers AREN'T maintained. Any damage sustained is beyond our repair. Although, Mars Phoenix lander once fixed itself by hitting itself with its shovel. And recently, InSight did the same thing. Only the spacecraft themselves can fix something on board, if it's within the technological barrier.