"Agree on" vs. "agree with" vs. "agree to"
Solution 1:
The object is the difference.
-
When you agree with someone/something, it means you accept the point of someone/something.
I agree with you.
Matt does not agree with my answer.
-
You agree on some issue or point of debate.
We agreed on this issue.
-
You agree to demands/queries, or you agree to do something.
He agreed to my demands.
He agreed to join me for the movie.
Solution 2:
A quote from "A valency dictionary of English" (Herbst et al. 2004: 25), with some modifications:
A. Agree can mean 'be of the same opinion'
(i) People can agree on or about a particular topic or issue.
(ii) A person can agree with another person on or about a particular topic or issue.
(iii) A person can agree that something is the case.
B. Agree can mean 'consent'.
(i) A person or organisation can agree to or with something suggested.
(ii) A person or organisation can agree to do something suggested.
C. If two statements or versions of something agree, they are the same; if figures or calculations agree, they show the same result. Grammatical categories also agree, i.e. correspond in number etc.
D. Agree can mean 'come to a common conclusion'.
(i) People can agree some course of action, i.e. decide upon it.
(ii) People can agree on something as the result of a discussion.
(iii) People can agree to do something.
E. If something such as food or the climate does not agree with a person, it causes them problems.
Solution 3:
When two or more people agree on something, it means they have the same opinion about something being discussed. To agree with someone is to share a point of view with him/her, and to agree with an idea or proposal is to accept it and to believe that it's valid. Example use that includes both prepositions: "He agreed with you on whether we should increase the salary."
You use "agree to" to imply that a request was made and that the person towards whom the request was directed responded positively to that request -- i.e., he/she agreed to do whatever the requester was asking him to do. Example: "She agreed to be my prom date." (There are other, more slang and common phrasings to talk about proms, though.)