Sufficient conditions for linear mapping $T:X \to Y$ being continuous I can neither prove nor disprove the following statement.
I would be grateful if anyone could give me some advice.

Let $X$ and $Y$ be complex Banach spaces,
and let $T:X \to Y$ be a linear mapping.
Let $D \subset X$ be a dense subset of $X$ ($D$ is NOT necessarily a subspace of $X$),
and $\|Tx\|_Y \leq C \|x\|_X$ for all $x \in D$.
Then, $\|Tx\|_Y \leq C\|x\|_X$ for all $x \in X$.

 A: It's false if you assume $D$ to be a proper dense subspace of infinite codimension, let alone more general dense sets. As an example, if we take $X = C[0, 1]$ (with the $\infty$-norm), and $D$ to be the subspace of polynomials on $[0, 1]$, then Stone-Weierstrass implies $D$ is a dense subspace of $X$. As $D$ has countable dimension, it must have (uncountably) infinite codimension, as infinite-dimensional Banach spaces cannot have uncountably infinite dimension (by Baire Category Theorem).
If we suppose $D$ is a dense, proper subspace of Banach space $X$ with infinite codimension and $Y$ is non-trivial, you'd be asserting that every extension of a bounded linear map $S : D \to Y$ to $X$ must also be bounded, with the same norm. This is patently untrue.
Suppose we have such a linear map $S$. Start with a hamel basis $B$ of $D$, and let $B' \subseteq X$ such that $B \cup B'$ is a basis of $X$. Without loss of generality, assume every vector in $B \cup B'$ has length $1$. Since $D$ has infinite codimension, $B'$ is infinite.
Select a sequence $x_n \in B'$, and some $y \in Y \setminus \{0\}$. Define $\hat{S}$, an extension of $S$ to $X$, on the Hamel basis $B \cup B'$, by letting
$$\hat{S}(x) = \begin{cases} S(x) & \text{if }x \in B \\ ny & \text{if } x = x_n \\ 0 & \text{if }x \in B' \setminus \{x_1, x_2, \ldots\}.\end{cases}$$
The above uniquely defines a linear map $\hat{S} : X \to Y$, which cannot be bounded, as $\|x_n\| = 1$, but $\|\hat{S}(x_n)\| = n\|y\| \to \infty$ as $n \to \infty$.
So, in specific reference to your question, let $T = \hat{S}$, and note that $\|Tx\| \le \|S\|\|x\|$ for $x \in D$, but $T$ is unbounded on $X$.
