5. The function $f(x)=\left\{\begin{array}{l}x, x \in P \\ -x, x \in M\end{array}\right.$, where $P$ and $M$ are two non-empty subsets of the set of real numbers $\mathbf{R}$, and it is defined that $f(P)$ $=\{y \mid y=f(x), x \in P\}, f(M)=\{y \mid y=f(x), x \in M\}$. Given the following four statements:
(1) If $P \cap M=\varnothing$, then $f(P) \cap f(M)=\varnothing$; (2) If $P \cap M \neq \varnothing$, then $f(P) \cap f(M) \neq \varnothing$;
(3) If $P \cup M=\mathbf{R}$, then $f(P) \cup f(M)=\mathbf{R}$; (4) If $P \cup M \neq \mathbf{R}$, then $f(P) \cup f(M) \neq \mathbf{R}$. Which of the following statements are correct? $\qquad$
5. (2) and (4) are correct. Detailed explanation: (1) is incorrect, for example, when $P=(0,+\infty), M=(-\infty, 0)$, $f(P) \cap f(M)=P \neq \varnothing$. (2) is correct, since there exists $x_{0} \in P \cap M$, such that $x_{0}=f\left(x_{0}\right)=-x_{0}$, thus $x_{0}=0$, i.e., $P \cap M=\{0\}$, hence $f(P) \cap f(M)=$ $\{0\}$, this option is correct. (3) is incorrect, for example, when $P=[0,+\infty), M=(-\infty, 0)$, $P \cup M=\mathbf{R}$, but $f(P) \cup f(M)=P \neq$ R. (4) is correct, assuming when $P \cup M \neq \mathbf{R}$, it is possible that $f(P) \cup f(M)=\mathbf{R}$, then there exists $x \in \mathbf{R}$, such that $\left\{\begin{array}{l}x \notin P \cup M \\ x \in f(P) \cup f(M)\end{array}\right.$, thus $x \notin P$, and $x \notin M$, then there must be $-x \in M$; if $-x \in P$, then $-x \in M \cap P$, thus $x=0 \notin P \cup M$, and hence $x \notin f(P) \cup$ $f(M)$, contradiction! If $-x \notin P$, then $-x \notin f(P)$, it can only be that $-x \in f(M)$, there must be $x \in M$, contradiction! Therefore, (4) is correct. In summary, (2) and (4) are correct.