In order to understand this verse, we need the context of Romans 1:16.
So when we read Romans 1:17,
The "it" here is referring to the gospel. So this is saying that the righteousness of God is revealed in the gospel from faith. Or in other words, it takes faith to see the righteousness of God revealed.
Side Bar
If you find yourself asking, "Faith in what?" It's faith that the gospel's message is true, that it can change you for the better, and that Jesus of Nazareth died on a cross for you and paid for your sins. You can't earn this blessing; it's freely given.
Let's Continue
Now the second part of this verse is tricky, "for faith." It's giving us a purpose for the righteousness being revealed. The gospel, or Jesus's story, is the cause of your faith, and as you grow in your walk with Jesus, that same story then strengthens your faith.
Then you get, "The righteous shall live by faith." The Holy Spirit changes us through continual faith and obedience. This verse doesn't say, "The righteous shall live by works." That's not to say that works won't come from your matured faith, but those works will come through faith in the goodness of God's plan for you. The Holy Spirit will be your guide; Jesus will be your strength; you just have to listen.