Let $(X, O_X)$ be a scheme and $Q$ an $O_X$-ideal. I am trying to figure out two details about this and any explanation is appreciated. Thank you!
1) How come $Y = \{ y \in X: 1 \notin Q_y \}$ a closed subset of $X$?
2) How to show that the cokernel of $0 \to Q \to O_X$ is $0$ outside of $Y$?
Both questions are local so you can assume that $X=\operatorname{Spec} A$ and that $Q\subseteq A$ is an ideal.
For a prime ideal $\mathfrak{p}\in \operatorname{Spec} A$ we see that $1\notin Q_{\mathfrak{p}}$ if and only if $Q_{\mathfrak{p}}$ is a proper ideal in $A_{\mathfrak{p}}$, which means that $Q\subseteq \mathfrak{p}$. Hence $Y=\{ \mathfrak{p} \in \operatorname{Spec} A \,|\, \mathfrak{p}\supseteq Q \}$, which is closed by definition of Zariski topology.
The cokernel of the map $Q\to A$ is $A/Q$ and since localization is exact, we have that $(A/Q)_{\mathfrak{p}} = A_{\mathfrak{p}}/Q_{\mathfrak{p}}$. So, if $\mathfrak{p}\notin Y$, then the previous point shows that $Q_{\mathfrak{p}}=A_{\mathfrak{p}}$, and then $(A/Q)_{\mathfrak{p}} = 0$.