What does it exactly mean for a subspace to be dense? My understanding of rationals being dense in real numbers:
I know when we say the rationals are dense in real is because between any two rationals we can find a irrational number. In other words we can approximate irrational numbers using rationals. I think a more precise definition would be is that any open ball around a irrational number will contain a rational number. 
If what I said is correct, I am trying to think about what it means for $C[a,b]$ (which are the continuous complex valued functions on [a.b]) to be dense subspace of $L^2[a,b]$. From what I said above, I want to say that all functions in $L^2[a,b]$ can be approximated by functions from $C[a,b]$. Is the intuition correct here, what would the precise definition in this case?
 A: Given a metric space $(X,\rho)$, we say that a subset $A$ of $X$ is dense in $X$ if, for each $\epsilon >0$ and $x\in X$ $$\tag 1 B(x,\epsilon)\cap A\neq \varnothing$$
This can be put more succinctly as ${\rm cl}\; A=X$. That is, the closure of $A$ is $X$. The assertion in $(1)$ is saying that $A$ is "everywhere": no matter what point we pick in $X$; and no matter how small a ball we choose, there will always be an element $a$ of $A$ in $B(x,\epsilon)$. And this means $\rho(x,a)<\epsilon$. So, the answer is "yes": we can approximate any $x\in X$ by any $a\in A$ within any prescribed degree of accuracy.
As an example, polynomials are dense in $C[a,b]$ with the $\sup$ metric. Given $f\in C[a,b]$, and $\epsilon >0$ we can find a polynomial $P$ such that $$\lVert f-P\rVert_\infty=\sup_{x\in [a,b]}|f(x)-P(x)|<\epsilon$$
ADD As Brian as commented, in the case of metric spaces we can translate the above to the following:

Let $(X,\rho)$ be a metric space, $A$ a subset of $X$. Then $A$ is dense in $X$ if and only if for each $x\in X$ there exists a sequence of points $\langle x_n\rangle$ in $A$ such that $x_n\to x$.

The proof is not complicated, so I invite you to give it. 
The above happens to be true in metric spaces, but is not true in general, that is, for any topological space $(X,\mathscr T)$.
A: In general topological spaces, a dense set is one whose intersection with any nonempty open set is nonempty. For metric spaces, since we have a topological base of open balls, this is equivalent to every point in space space being arbitrarily close, with regards to the metric, to point in the dense set.
Note that $L^2$ is a metric space, where $d(f,g) = ||f-g||_2$, with $||\cdot||_2$ being the $L^2$ norm.
A: Your generalization is (more or less) correct. In a metric space $M$, we say a subset $D\subseteq M$ is dense if for every open ball $B$, there is at least one member $d\in D$ that is also in $B$. In a topological space, we say a subset is dense if it meets every non-empty open neighborhood. 
Now, towards answering your question. We know that $L^2([a,b])$ is a metric space, with it's metric given by $d(f,g)=\int_a^b |f-g|^2\ dx$. So for the continuous functions to be dense, we need them to meet every open ball. More precisely the continuous functions are dense if, for a given $f$ and $\epsilon>0$, there exists a continuous function $g$ so that $\int_a^b |f-g|^2\ dx<\epsilon$. 
There are plenty of ways to show this, depending on where you are in your measure theory studies. If you've just begun, look at Littlewood's three principles (Luzin's theorem will help you here). For readers a bit more familiar with the theory, one may take an approximation to the identity $\phi_n$, and put $f_n=\phi_n*f$.  Then $f_n$ is continuous, being the convolution of two $L^1$ functions ($L^2$ functions are $L^1$ on finite measure sets by Cauchy-Schwarz) and $f_n$ converges in $L^2$ norm to $f$. 
