About the kernel of the structure map of a morphism of schemes Let $f:X\to Y$ be a morphism of schemes, let $\mathcal{K}$ be the kernel of the structure map $\mathcal{O}_Y\to f_*\mathcal{O}_X$. Do we have

$$\mathrm{Supp}(\mathcal{O}_Y/\mathcal{K})=\overline{f(X)}?$$

Recall that the support of a sheaf (of abelian groups) is the set of points at which the stalk of that sheaf is nonzero.
I can prove $\subset$ as follows: If $y\in Y$ is in the support, then $(f_*\mathcal{O}_X)_y\neq 0$ (since the image of $1$ is $1$), so for any open neighborhood $V$ of $y$, we have $\mathcal{O}_X(f^{-1}V)\neq 0$, so $f^{-1}V\neq \emptyset$, thus $y\in \overline{f(X)}$. How about the convese? As $\mathcal{O}_Y/\mathcal{K}$ is of finite type, the support is closed, so one possible way is to show $f(X)\subset\mathrm{Supp}(\mathcal{O}_Y/\mathcal{K})$.
Somebody told me it's always true but you can add some mild conditions if you need.
 A: I think I can prove "=" in one stroke (without extra assumption), in detail as follows: the key observation is that any ring hom maps $0$ to $0$ and $1$ to $1$, and for the structure sheaf of a scheme $X\neq \emptyset$, we have $1\neq 0\in\mathcal{O}_X(U)\Leftrightarrow \mathcal{O}_X(U)\neq 0\Leftrightarrow U\neq \emptyset$. Thus
$$y\in \mathrm{Supp}(\mathcal{O}_Y/\mathcal{K})\Leftrightarrow (\mathcal{O}_Y/\mathcal{K})_y\neq 0\Leftrightarrow (f_*\mathcal{O}_X)_y\neq 0\Leftrightarrow 1\neq 0\in(f_*\mathcal{O}_X)_y\Leftrightarrow 1\neq 0\in(f_*\mathcal{O}_X)(V), \forall V\Leftrightarrow \mathcal{O}_X(f^{-1}V)\neq 0, \forall V\Leftrightarrow f^{-1}V\neq \emptyset, \forall V\Leftrightarrow V\cap f(X)\neq \emptyset, \forall V\Leftrightarrow y\in \overline{f(X)},$$
where $\forall V$ means for all open neighborhoods $V$ of $y$ in $Y$; the 2nd $\Leftrightarrow$ is because we have an injective ring hom $(\mathcal{O}_Y/\mathcal{K})_y\rightarrow(f_*\mathcal{O}_X)_y$; the 4th $\Leftrightarrow$ is because the stalk is a filtred colimit over all open neighborhoods. Thus
$$\mathrm{Supp}(\mathcal{O}_Y/\mathcal{K})=\overline{f(X)}.$$
Edit:
According to the answer and comments below, the stated result is actually true for all morphisms of locally ringed spaces (but not for morphisms of ringed spaces), with the same argument.
A: Here's one way to see this if we assume that $f$ is quasi-compact:
First note that the statement is true if both $X,Y$ are affine, say $X=\operatorname{Spec}(B)$ and $Y=\operatorname{Spec}(A)$. Indeed in this case, we have that $\overline{f(X)} = V(I)$, where $I$ is the kernel of the map $A\rightarrow B$. Of course here we have that $\operatorname{Supp}(A/I) = V(I)$. 
Now let's suppose that $f$ is quasi-compact. We can assume that $Y$ is affine. Since $f$ is quasi-compact, we can cover $X$ by finitely many affine opens $U_i$, and we have that $\overline{f(X)} = \overline{ \bigcup_i f(U_i) } = \bigcup_i \overline{f(U_i)}$ (we used finiteness for the last equality). 
By the above, we have that $\overline{f(U_i)} = \operatorname{Supp}(\mathcal{O}_Y/K_{U_i})$, where $K_{U_i}$ is the kernel of the map $\mathcal{O}_Y \rightarrow (f|_{U_i})_* \mathcal{O}_{U_i}$. We claim that $\operatorname{Supp}(\mathcal{O}_Y/K_{U_i}) \subseteq \operatorname{Supp}(\mathcal{O}_Y/K_X)$, where $K_X$ is the kernel of the map $\mathcal{O}_Y \rightarrow f_* \mathcal{O}_X$. This follows from the fact that $K_X \subseteq K_{U_i}$. 
This implies that $\overline{f(X)} \subseteq \operatorname{Supp}(\mathcal{O}_Y/K_X)$. 
