Why is the charge of an electron taken to be the negative of the charge of a proton and vice versa? Let us assume that all we know till now is that two types of charges exist. One of them is possessed by an elementary particle called an electron and the other by another elementary particle called a proton. We also know that the effect of a proton on another proton is the same as that of an electron on another electron in terms of the force of repulsion and an electron and proton also have a similar effect on each other other than the fact that they attract each other, and not repel.
Now, let us say that the charge of an electron is $1 \text{ e}$. Why do we take the charge of a proton as $-1 \text{ e}$ only based on the information that they have similar but opposite effects? Now, if we define the charge of a proton as $-1 \text{ e}$, the net charge of a body with $n_1$ electrons and $n_2$ protons becomes $n_1e+n_2(-e) = (n_1-n_2)e$. How do we know that the results obtained from these mathematical operations will be what the actual effects will be?
I don't know if I was able to express my question properly. I'm finding it hard to express what I have in mind. Please let me know if it is not clear, I will try my best to improve it.
Thanks!
 A: I think your question is a little unclear, so let me know if I've misunderstood what you were asking.
If your question is about how we know that the electron and the proton have the same magnitude but opposite signs, it's simple (at least in theory): create a Hydrogen atom. It has one proton and one electron, and it's neutral overall, meaning it has a net charge of zero. Since charges simply add up, the proton and the electron must have opposite charges.
On the other hand, if your question is about why one of them is "called" negative and the other positive, I refer you to E.M. Purcell's excellent text. From Chapter 1.1 (Electric Charge):

What we call negative charge, by the way, could just as well have been called positive. The name was a historical accident. There is nothing essentially negative about the charge of an electron. It is not like a negative integer. A negative integer, once multiplication has been defined, differs essentially from a positive integer in that its square is an integer of opposite sign. But the product of two charges is not a charge; there is no comparison.

As to your question

How do we know that the results obtained from these Mathematical operations will be what the actual effects will be?

I think you have it backwards. The effects were first discovered experimentally, and then the mathematical operations were defined. In other words, two charges of charge $+q$ each were found experimentally to have the same effect as a charge of $+2q$, a combination of charges $+q$ and $-q$ was found to have the net effect of $0$ charge, and so on.
A: It’s actually the other way round. Observations lead to formulating the math in this particular way. As it should be in science. Following is a brief history of the same.
The world around us by and large is neutral. It was only when electricity was discovered, we had to come up with the concept of charges. One thing to note is that the concept of charge (and current) predates the discovery of electron.
People in the late 18th century discovered that in some scenarios there was attraction between charges and in others they repelled. So they hypothesised there being two kinds of charges. Then the question came as to why are most materials uncharged? Are there actually three kinds of charges?
Then they observed that unlike charges attracted each other up to a point after which there was no more charge. So they realised that the unlike charges effectively cancel each other off. And this explained why most of the materials were neutral. As a natural extension, one kind was measured by positive numbers and the other by negative, as equal amounts of both resulted in no charge.
And on this basis, Coulomb’s law was discovered and a century later Maxwell’s equation.
In 1897 the electron was discovered, and it’s charge was measured in 1909. The proton was discovered in 1896 as a hydrogen ion. Since it was known that hydrogen atom is formed by an electron and a proton and that it was neutral, it was discovered that they have charges that are equal and opposite.
Later in 1917 it was confirmed that proton was in fact the source of positive charge in all other elements.
