Let $X = \mathbb{R}^2$ with $(x, y)\in X$ for $y\neq 0$ isolated and $(x, 0)$ having neighbourhood basis of the form $$U_n(x) = \{(x, y) : y\in (-1/n, 1/n)\}\cup \{(x+y+1, y) : 0 < y < 1/n\}\cup \{(x+\sqrt{2}+y, -y) : 0 < y < 1/n\}.$$ The space $X$ is called Mysior plane, and it's an example of a space which is a union of two closed subspaces, $X_+ = \mathbb{R}\times [0, \infty)$ and $X_- = \mathbb{R}\times (-\infty, 0]$, which are realcompact, but isn't itself realcompact.
Since the map $f:X_+\sqcup X_-\to X$ is perfect, this shows realcompactness is not invariant under perfect mappings.
The space $X$ is Tychonoff: Say $(x, y), (w, t)\in X$. If $y\neq 0$ or $t\neq 0$ this is quite obvious since one of the points is isolated. If $y = t = 0$, and $x < w$, then by splitting into three cases $x < w \leq x+1, x+1 < w \leq x+\sqrt{2}$ and $w\geq x+\sqrt{2}$ one can easily see that we have disjoint neighbourhoods. Thus $X$ is Hausdorff. If $(x, y)\notin F$ and $F$ is closed, of course the only interesting case is when $y = 0$ for otherwise $\{(x, y)\}$ is clopen. In that case we can find $n$ with $U_n(x)\subseteq F^c$. By defining $f(w, t) = 1$ for $(w, t)\notin U_n(x)$ and $f(w, t) = nt$ for $(w, t)\in U_n(x)$, we see that $f$ is continuous and so $X$ is Tychonoff.
To see that $X_+$ and $X_-$ are realcompact, lets focus on $X_+$. If $\mathcal{F}$ is a real z-ultrafilter on $X_+$, then since $\mathbb{R}\times [0, a]$ for $a > 0$ is clopen, we can see that if $\mathbb{R}\times (a, \infty)\in\mathcal{F}$, then $\mathcal{F}\restriction_{\mathbb{R}\times (a, \infty)}$ is a real z-ultrafilter on the realcompact space $\mathbb{R}\times (a, \infty)$, and as such is fixed, so that $\mathcal{F}$ is fixed. Otherwise, if for all $a > 0$, $\mathbb{R}\times [0, a]\in \mathcal{F}$, then $\mathbb{R}\times \{0\}\in\mathcal{F}$ since $\mathcal{F}$ is closed under countable intersections. One can observe that $([a, b]+\mathbb{Z})\times \{0\}$ for $a < b$ are zero sets of $X_+$ by construction appropriate functions (similar to the one in the proof that $X$ is Tychonoff). Thus $([0, 1/2]+\mathbb{Z})\times \{0\}\in \mathcal{F}$ or $([1/2, 1]+\mathbb{Z})\times\{0\}\in \mathcal{F}$, for example the former case holds. Take $a = \sup \{x\in [0, 1/2] : ([x, 1/2]+\mathbb{Z})\times\{0\}\in \mathcal{F}\}$ and $b = \inf\{x\in [a, 1/2] : ([a, x]+\mathbb{Z})\times\{0\}\in\mathcal{F}\}$. Once again one would show that $[a, b]+\mathbb{Z}\in \mathcal{F}$ from closure under countable intersections, and if $a\neq b$ we could take $a < c < b$ and by considering $([a, c]+\mathbb{Z})\times\{0\}$ and $([c, b]+\mathbb{Z})\times\{0\}$ obtain a contradiction with choice of $a, b$. Thus $(a+\mathbb{Z})\times\{0\}\in\mathcal{F}$ for some $a\in \mathbb{R}$. However, since $(a+\mathbb{Z})\times\{0\} = \bigcup_{n\in \mathbb{Z}}\{(a+n, 0)\}$ is a countable union of zero sets, and since $\mathcal{F}$ is a real z-ultrafilter, we must have $\{(a+n, 0)\}\in\mathcal{F}$ for some $n$, that is $\mathcal{F}$ is a fixed z-ultrafilter. This proves $X_+$ is realcompact, the proof for $X_-$ is the same.
Could anyone help me on how to show that $X$ is not realcompact?
Edit: A z-ultrafilter is an ultrafilter on the lattice of zero sets (as to distinguish them from ultrafilters on the lattice of sets), and a real z-ultrafilter is a z-ultrafilter closed under countable intersections.