homeomorphism between R^(n^2) and M_n(R)

how do you show that M_n(R) and R^(n^2) are homeomorphic? i defined a function f:M_n(R) -> R^(n^2) such that if you input any real matrix, you get out a vector that is set up as (a11, a12, ... a21, a22, ..., a_nn) so basically i go along the first row then the second row then 3rd row and so on of the matrix and put the elements in the order i get to them while doing this process. so i can see that this function is a bijection and now i need to show that both the function f and f^-1 are continuous and i am a bit lost on how to do that.