What are the requirements for separability inheritance Suppose we have an arbitrary separable topological space $X$. What are some (possibly nonequivalent) minimal requirements to put on $X$ to ensure that every subspace of $X$ is separable?
This is not true for arbitrary spaces, as witnessed by the the space $X$ which is uncountable, where open sets are precisely the sets containing some special point $x_0$. It is separable (because $\lbrace x_0\rbrace$ is dense), but $X\setminus \lbrace x_0\rbrace$ is uncountable and discrete, so not separable. However, this space is not even $T_1$ (though it is $T_0$).
It is clearly true for second-countable spaces (because weight is not smaller than density, and is inherited), but that is not necessary, as shown by an example similar to the above, but with $X$ countable.
Analogous question could be asked replacing $\aleph_0$ with arbitrary infinite cardinal $\kappa$: suppose we have a space $X$ with a dense subset of cardinality at most $\kappa$, what should we require of $X$ for this to be inherited? In this case we can perform the analysis which is exactly analogous to the above, but perhaps some more concrete results will be harder to arrive at with uncountable $\kappa$...
So I really have two somewhat related questions. In terms of cardinal invariants density $d$ and hereditary density $hd$, what requirements do we have to put on $X$ to have some of the following:


*

*(Only for $X$ separable) $hd(X)\leq\aleph_0$

*$d(X)= hd(X)$


By analysis similar to the above we know that 2. is not true in general, as well as that $d(X)=w(X)$ implies 2, but is not necessary.
I would appreciate some conditions which would imply either one, or some nice counterexamples which satisfy some stronger separation axioms than just $T_0$ (if there are any, I think there should be...), or a proof that there are none.
Edit: 
Sam L. suggested the example of Niemytzki plane, which shows that even somewhat strong separation axioms are not sufficient: it is completely regular and separable and of countable character, but has an uncountable discrete subspace. It is not hard to see that by taking a suitable subspace, we can strengthen it to $w(X)=\aleph_1$ (regardless of CH), and itself is a counterexample for all $\kappa<\mathfrak c$.
Edit 2:
As per Arthur Fischer's suggestion, if we take an arbitrary nontrivial second-countable compact Hausdorff space $X$ (such as $2$ with discrete topology or $[0,1]$), $X^\mathfrak c$ will be separable (because product of at most $\mathfrak c$ separable spaces is separable), as well as Hausdorff and compact, and hence normal, but it has a discrete subspace of cardinality $\mathfrak c$.  This shows that no usual separation axioms will suffice, not even augmented by compactness.
 A: 
Note (19 May 2022): The original proof of the theorem was a bit sloppy; I’ve cleaned it up and rewritten the proof of the corollary to make it a bit simpler.

The results in the comments are all negative. Here’s a positive result, albeit with a rather strong hypothesis:
Theorem: Every LOTS (space whose topology is generated by a linear order) has hereditary density equal to its density.
Proof: Let $\langle X,\le\rangle$ be a LOTS, and let $Y$ be a subspace of $X$. Let $D$ be a dense subset of $X$ of cardinality $d(X)$, and without loss of generality assume that $D$ contains the endpoint(s) of $X$, if any. For each $a,b\in D$ with $a<b$ and $(a,b)\cap Y\ne\varnothing$ fix $y(a,b)\in(a,b)\cap Y$. Let $I$ be the set of isolated points of $Y$, and let $$E=\{y(a,b):a,b\in D\text{ and }a<b\text{ and }(a,b)\cap Y\ne\varnothing\}\,.$$

Claim: $I\cup E$ is dense in $Y$.
Proof: Let $U$ be any non-empty open subset of $Y$. If $U\cap I\ne\varnothing$, we’re done, so assume that $U\cap I=\varnothing$. Fix $y\in U$; there are $a,b\in D$ such that $a<y<b$ and $(a,b)\cap Y\subseteq U$, and clearly this ensures that $y(a,b)\in U$. $\dashv$

Let $I_X$ be the set of isolated points of $X$, $X_L=\{x\in X:x\in\operatorname{cl}_X(\leftarrow,x)\}$, and $X_R=\{x\in X:x\in\operatorname{cl}_X(x,\to)\}$. Let
$$\begin{align*}
I_0&=I\cap I_X\,,\\
I_1&=I\cap(I_L\setminus I_R)\,,\text{ and}\\
I_2&=I\cap(I_R\setminus I_L)\,,\text{ and}\\
I_3&=I\cap I_L\cap I_R\,;\\
\end{align*}$$
clearly $I=I_0\cup I_1\cup I_2\cup I_3$.
Suppose that $y\in I_3$; then there are $a_y,b_y\in D$ such that $(a_y,b_y)\cap Y=\{y\}$, so $y=y(a_y,b_y)\in E$. Clearly $|E|\le d(X)$, so to show that $d(Y)\le d(X)$, it suffices to show that $|I_k|\le d(X)$ for $k\in\{0,1,2\}$.
For $I_0$ this is trivial: $I_0\subseteq I\subseteq D$, so $|I_0|\le d(X)$. Now suppose that $y\in I_1$. Then either $y$ has an immediate successor $y^+$ in $X$, or $y=\max_\le X$, and in either case there is an $a_y\in D$ such that $(a_y,y]$ is an open nbhd of $y$ in $X$ such that $(a_y,y]\cap Y=\{y\}$. It follows that if $y,y'\in I_1$, and $y<y'$, then $y\le a_{y'}$ and hence $(a_y,y]\cap(a_{y'},y']=\varnothing$. That is $\{(a_y,y]:y\in I_1\}$ is a family of pairwise disjoint open subsets of $X$, and since each must contain a member of $D$, we must have $|I_1|\le|D|=d(X)$. The argument that $|I_2|\le d(X)$ is entirely similar, and the theorem is proved. $\dashv$
Added: The result can be strengthened a bit. A GO-space is a Hausdorff space $\langle X,\tau\rangle$ with a linear order $\le$ such that every point of $X$ has a local base of $\le$-intervals; these intervals may be open, closed, or half-open, and if they’re closed, they may be degenerate. It’s well-known that $X$ is a GO-space iff $X$ is a subspace of a LOTS.
Corollary: If $X$ is a GO-space, then $d(X)=hd(X)$.
Proof: Let $\langle X,\tau\rangle$ be a GO-space with associated linear order $\le$, and let $D$ be a dense subset of $X$ of cardinality $d(X)$. Let $\tau_\le$ be the order topology on $X$ generated by $\le$; $\tau_\le\subseteq\tau$. Let $$L=\{x\in X:[x,\to)\in\tau\setminus\tau_\le\}$$ and $$R=\{x\in X:(\leftarrow,x]\in\tau\setminus\tau_\le\}\;.$$ Note that $L\cap R\subseteq D$.
Let $$X^+=\Big(X\times\{1\}\Big)\cup\Big(L\times\{0\}\Big)\cup\Big(R\times\{2\}\Big)\;,$$ let $\preceq$ be the lexicographic order on $X^+$ determined by $\le$ on $X$ and the usual order on $\{0,1,2\}$, and let $\tau_\preceq$ be the order topology on $X^+$ induced by $\preceq$. Let $X'=X\times\{1\}$; it’s a little tedious but not difficult to verify that the map $X\to X':x\mapsto\langle x,1\rangle$ is a homeomorphism of $X$ onto the subspace $X'$ of $\langle X^+,\tau_\preceq\rangle$. Let $D\,'=D\times\{1\}$.

Claim: $D\,'$ is dense in $X^+$.
Proof: Clearly $D\,'$ is dense in $X'$, so it suffices to show that $X'$ is dense in $X^+$. Suppose that $p=\langle u,k\rangle,q=\langle v,\ell\rangle\in X^+$, and $p\prec q$. If $u<x<v$, then $\langle x,1\rangle\in X'\cap(p,q)$, so suppose that $v$ is the immediate successor of $u$ in $X$. Then $u\notin R$, so $k\ne 2$, and $v\notin L$, so $\ell\ne 0$. If $k=0$, then $\langle u,1\rangle\in X'\cap(p,q)$, and if $\ell=2$, then $\langle v,1\rangle\in X'\cap(p,q)$. The only remaining possibility is that $k=1=\ell$, but in that case $(p,q)=\varnothing$, and there is nothing to prove. $\dashv$

Then since $X^+$ is a LOTS, we have
$$hd(X^+)=d(X^+)\le|D\,'|=|D|=d(X)\,.$$
But $X'$ is a subspace of $X^+$, so
$$d(X)=d(X')\le hd(X')\le hd(X^+)\le d(X)\,,$$
and hence $d(X)=hd(X)$, as desired. $\dashv$
