Good question. First we have to define "prostate function." The simple fact is that we do not really understand why we have a prostate. There are reasonable assumptions that it has to do with fertility. I say assumptions because such assumptions cannot be tested (we cannot remove prostates and check fertility because to remove prostates is to do a de facto vasectomy; plus men kinda object to having their prostates removed). As a practical matter, assuming this is correct, is it an issue? Are you trying to preserve your fertility???
Let us define "prostate problems" as benign enlargement (BPH), prostatitis, and cancer. There is not a good body of literature to support that sex prevents such problems.