If you want to save money, and have a better chance to get into UCSD, go CC and do well, have exceptional extra curriculars, and apply to UCSD in your first or second year. However, know there is no guarantee that you will get in and you might miss out on the “college” experience.
If you don’t care about money as much, and want to experience a four year college, go to UCR and enjoy your time, learn and do well and expect to be there all four years. However, apply to UCSD after likely two if you’re not satisfied or if you still want to go to UCSD. By that time, you may decide to stay at UCR.
Although there’s likely less transfers from UC to UC, than CC to UC, it does happen. You just have to be more exceptional than others and get a little lucky! But either way, you cannot expect to get in. It’s never guaranteed either way.