can you contribute the 17,000 max to your 401k and then the 5,000 max to your roth ira as long as you are within the income requirements?
Your 401k limit and traditional (or ROTH) IRA limits are separate limits. As long as you have sufficient earned income, you can contribute to both a 401k and an IRA. If you are married, your spouse can also contibute to an IRA based on your earned income. Ed is correct that the ROTH phaseout for individual tax payers starts at $110,000. Here is the IRS reference table for 2012: http://www.irs.gov/retirement/participant/article/0,,id=188238,00.html
Even if you are above the AGI limit for a ROTH contribution in 2012, there is a backdoor way to move savings into a ROTH account. Make a non-deductible contribution to a traditional IRA, then immediately convert the account to a ROTH. There is no income limit for non-deductible IRAs, and since there will be no appreciation in the account, you will owe no tax provided you do not have pre-tax IRA balances. Your funds will be subject to a tax surcharge if you withdraw funds from the account in the first 5 years, but otherwise this strategy is virtually identical to making a direct ROTH contribution.
If you have pre-tax IRA balances then you should consult with a financial advisor to determine the tax consequences of this strategy. Unfortunately, the IRS does not allow tax payers to cherry pick IRA accounts for conversion. Any partial conversion is treated, for tax purposes, as a pro-rata conversion of your aggregate IRA balances. There are sound ways to mitigate or even eliminate this tax risk, or it may be desirable to accelerate the liability. You should consult with an advisor to understand the issues that apply to your particular circumstances.
I agree with both Eddie's and James' answers. They get to the heart of the question. I would only add that, if a plan participant cannot max out both their 401(k) and a Roth IRA contribution, he should consider the priority or order that his contributions should to each type of account should be allocated. While a well thought out analysis and any resulting recommendation would be fairly complicated and include a number of factors that are beyond the scope of this discussion (e.g., 401(k) plan expenses, internal expenses of investments, whether the participant is a high earner with substantial assets in pre-tax Traditional IRA accounts, whether the participant has competent fiduciary advise relating to the manaement of his Roth IRA account), an "all things being equal" rule of thumb that I recommendation for the order in which contributions should be allocated is:
The above list assumes that the participant's plan does not offer an allocation to a Roth account within the plan. If it does, there might be no need to bring a Roth IRA into the conversation unless he has the wherewithal to contribute an amount that exceeds the statutory maximum of a 401(k).
There are other issues that should be considered relating to things like the 5-year rule. Those issues should be discussed with a fiduciary investment advisor since I have not taken that into account in this discussion.
In short, yes. You can contribute to a ROTH IRA without regard to your participation in a 401(k). The only thing that matters with your ROTH, is your adjusted gross income from your tax return. I believe the contribution eligibility for single people begins phaseout at $110,000.