The relation between a ring homomorphism $\phi$ and $\mathrm{Spec}(\phi)$ Let $\phi: A \to B$ be a ring homomorphism with $\phi(1_A)=1_B$. Let $\mathrm{Spec}(A)$ denote the set of all prime ideals of $A$. Let $f \in A$.
Consider the associated map $\phi^* = \mathrm{Spec}(\phi): \mathrm{Spec}(B) \to \mathrm{Spec}(A)$.
I have tried to show that
(a) $\mathrm{Im}(\phi^*) \subset V(f) \iff \phi(f) $ is nilpotent
(b) $\mathrm{Im}(\phi^*) \cap V(f) = \emptyset \iff \phi(f) $ is unit
I proved only if parts of statements of (a) & (b). But I couldn't write a valid argument for if parts. Any help or hint will be appreciated.
Note: For $x \in X=\mathrm{Spec}(A)$, we shall write an ideal with $j_x$. Then $$V(f)= \{x \in X : f \in j_x\} = \{x \in X : j_x \supset (f)  \}.$$ 
 A: Recall that the nilradical (the set of all nilpotent elements) is the intersection of all prime ideals of the ring: $\DeclareMathOperator{\Nil}{Nil} \DeclareMathOperator{\p}{\mathfrak{p}} \DeclareMathOperator{\Spec}{Spec} \DeclareMathOperator{\img}{img} \newcommand{\V}{\mathbb{V}} \Nil(B) = \bigcap_{\p \in \Spec(B)} \p$. Then
\begin{align*}
\varphi(f) \in \Nil(B) &\iff \forall \p \in \Spec(B), \varphi(f) \in \p\\
&\iff \forall \p \in \Spec(B), \, f \in \varphi^{-1}(\p) = \varphi^*(\p)\\
&\iff \forall \p \in \Spec(B), \varphi^*(\p) \in \V(f)\\
&\iff \img(\varphi^*) \subseteq \V(f) \, .
\end{align*}
See if you can figure out part (b) now. It should follow similarly from the observation that $\varphi(f)$ is a unit iff $\varphi(f) \notin \p$ for all $\p \in \Spec(B)$.
A: Hints:


*

*If $\phi(f)$ is nilpotent, it belongs to all prime ideals in $\operatorname{Spec}B$. Now use that, for any subset  $X$ in the set $A$,  one has $\;X\subset \phi^{-1}\bigl(\phi(X)\bigr)$.

*If $\phi(f)$ is a unit, it belongs to no prime ideal in  $\operatorname{Spec}B$. Use that for any subset   $Y$ in the set $B$,  one has $\;Y\subset \phi\bigl(\phi^{-1}(Y)\bigr)$.

