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.
All those operations are valid and well-defined for any $\;p\in\Bbb Z\;$ . What you can do with primes and not with non-primes is division. Fo example, $\;3/4\pmod 6\;$ has no meaning as $\;4\;$ is not invertible modulo $\;6\;$ , yet modulo any prime $\;\neq2,3\;$ it is, say
$$\frac34\pmod 7=3\cdot4^{-1}\pmod7=3\cdot2\pmod 7=6\pmod 7=-1\pmod 7$$