I am trying to find the correlation between two continuous variables but the values of one of them are originally given in intervals ([1-5] ,[6-9],...). What is the best approach to deal with this? Should I take the mean of each interval and use Pearson's r or rather rank the intervals and use Spearman's Rho?
It depends on the number of intervals that the observed data fall within. If you have a large number of intervals (e.g., more than 10), using the mean of each interval should be adequate. That is, you could recode the observations as the mean of the interval, and then produce the confidence interval as usual using the Fisher Z method.
However, if you have a small number of intervals, you'll have a large number of tied observations on one of your variables. In that case, you might consider concordance measures of association (e.g., gamma, Kendall's tau, etc.). Woods (2007) provides a good overview of confidence intervals for such measures.
References: Woods, C. M. (2007). Confidence intervals for gamma-family measures of ordinal association. Psychological Methods, 12, 185-204.
(unfortunately, this article is behind a pay wall)
You can find all possible values of the sample correlation coefficient using interval arithmetic. The result would be all possible values of correlation arising from all possible combinations of values of the variable whose values are given in intervals. For instance 4.3 and 7.2, or 1.9 and 8.8, etc.
INTLAB could be used to do the interval arithmetic calculations. http://www.ti3.tu-harburg.de/rump/intlab/ .