The basic modulo operations: $$(A + B ) \text{ mod } P = (A \text{ mod } P + B \text{ mod } P) \text{ mod } P\\(A - B ) \text{ mod } P = (A \text{ mod } P - B \text{ mod } P) \text{ mod } P\\(A * B ) \text{ mod } P = (A \text{ mod } P * B \text{ mod } P) \text{ mod } P$$
I have tried to prove that those operations are not valid when $P$ is not prime, but I cannot even start with it, since I'm begginer in proof-writing.