First, there are two types of loans: federally-subsidized and private loans. You can apply for federally-subsidized loans or you can apply for a loan from a private lender. Interest rates may be lower on the federally-subsidized loan than on a private loan, but not always. You will need to check the terms to see which loan is the best for you.
It is legal to take out a loan and deposit it in a savings account for repayment later. However, the lender on a student loan may not allow you to do this. In some cases, the lender pays tuition, fees and other costs directly to the school.
Would it be a good idea to take out a student loan and then pay it back? When interest rates on savings accounts are low, you would probably not make money. Whether or not you make money will depend on whether the interest rate of your savings account is higher than the interest rate of your student loan. In most cases, interest costs on student loans are not paid until graduation. So when you go to pay off the loan, you may find that you have not made much money on the savings account, and you still owe the interest due on the loan.
Another concern is if you will actually keep your student loan in a savings account and not spend the money. If you do use the money, you will have to start paying back the principal and the interest due when you graduate.