If you have obtained one analytic expression of probability density function, then to check that it is in fact a valid probability function, you have to show that the function is non-negative, i.e. it takes non-negative values for all values of x and its integration over the real line must be 1. This is the analytical way of checking that the function is a probability density.
There are random number generators based on some known distribution such as Gaussian, Rayleigh, uniform, etc. But if it is not any of such standard generators, then you have to write appropriate code. If you have some data then plot them on a graph paper and draw a curve roughly passing through these points. Then plot the graph of the function you have derived and compare them. This way you can check that the data comes roughly from this probability function.